You can try DROP it before creating ( DROP has an IF EXISTS clause):
ALTER TABLE mail_app_recipients DROP CONSTRAINT IF EXISTS mail_app_recipients_pkey; ALTER TABLE mail_app_recipients ADD CONSTRAINT mail_app_recipients_pkey PRIMARY KEY ("id_draft","id_person");
Note that this requires the mail_app_recipients_pkey name of the primary key constraint β in this example, mail_app_recipients_pkey .
jkukul
source share