catalog

information_schema.table_constraints

Lists constraints visible under information-schema privilege rules; not a complete substitute for native catalogs.

Formal Syntax & Structure

sql syntaxsql
SELECT constraint_name, constraint_type FROM information_schema.table_constraints WHERE table_schema = 'bm_lab' AND table_name = 'items' ORDER BY constraint_name;

Working Example

Example Snippetsql
-- Disposable PostgreSQL lab only; see LAB.md.SELECT constraint_name, constraint_type FROM information_schema.table_constraints WHERE table_schema = 'bm_lab' AND table_name = 'items' ORDER BY constraint_name;
SQL Reference