How to change PRIMARY KEY of an existing PostgreSQL table? · GitHub

PHOTO EMBED

Thu Apr 13 2023 14:59:25 GMT+0000 (Coordinated Universal Time)

Saved by @mvieira

-- Lastly set your new PRIMARY KEY
ALTER TABLE <table_name> ADD PRIMARY KEY (id);
content_copyCOPY

https://gist.github.com/scaryguy/6269293