patternsqlModerate
Show DOMAIN details
Viewed 0 times
showdomaindetails
Problem
Showing the columns and constrains of a table in PostgreSQL is done with:
Which lists the columns, data types and modifiers for a table.
How can I show the details and constraints of Posgresql domain?
\d+ Which lists the columns, data types and modifiers for a table.
How can I show the details and constraints of Posgresql domain?
Solution
To view all domains in your database, run in
You can see the list of all
psql\dD[S+] [PATTERN] list domainsYou can see the list of all
psql commands with \?.pg_constraint stores check, primary key, unique, foreign key, and exclusion constraints on tables. Column constraints are not treated specially. Every column constraint is equivalent to some table constraint. Not-null constraints are represented in the pg_attribute catalog, not here.Code Snippets
\dD[S+] [PATTERN] list domainsContext
StackExchange Database Administrators Q#73642, answer score: 11
Revisions (0)
No revisions yet.