Skip to content

Instantly share code, notes, and snippets.

@ajepe
Created October 21, 2019 11:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ajepe/5be33eea3b8e1c1dbf92b7ab7ca23cdc to your computer and use it in GitHub Desktop.
Save ajepe/5be33eea3b8e1c1dbf92b7ab7ca23cdc to your computer and use it in GitHub Desktop.
Check list of constraint on a table
SELECT con.* FROM pg_catalog.pg_constraint con INNER JOIN pg_catalog.pg_class rel ON rel.oid = con.conrelid INNER JOIN pg_catalog.pg_namespace nsp ON nsp.oid = connamespace WHERE nsp.nspname = 'public' AND rel.relname = 'product_product';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment