As of May 31, 2023, we have updated our Code of Conduct.

New answers tagged

0 votes

How to list all constraints of a table in PostgreSQL by schema?

You can execute this query select distinct 'Alter table '||c.conrelid::regclass||' Add CONSTRAINT '||c.conname||' '|| pg_get_constraintdef(c.oid)||';' FROM pg_constraint c ...
Fazlur Rahman's user avatar

Top 50 recent answers are included