Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

list all constraints in postgres

SELECT *
       FROM pg_catalog.pg_constraint con,
	   pg_catalog.pg_class rel,
	   pg_catalog.pg_namespace nsp
       WHERE
	   		rel.oid = con.conrelid
			AND nsp.oid = connamespace
	   		AND nsp.nspname like '<schema-name>'
			AND rel.relname like '<table-name>'
Source by dba.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #list #constraints #postgres
ADD COMMENT
Topic
Name
4+4 =