set primary key postgres code example
Example 1: postgres alter table add primary key
-- To set a column as primary key:
ALTER TABLE distributors ADD PRIMARY KEY (tablename);
Example 2: postgresql drop primary key constraint
alter table public.test1 drop constraint test1_pkey