How to add a primary key to an existing table PostgreSQL

4 sec read

ALTER TABLE table ADD primary key (primary_key_id);

Replace table with your table name and primary_key_id with your Primary Key

Last Updated On April 07, 2018

Leave a Reply

avatar
  Subscribe  
Notify of