How to add a primary key to an existing table PostgreSQL

ALTER TABLE table ADD primary key (primary_key_id);

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

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.