HiveBrain v1.2.0
Get Started
← Back to all entries
patternsqlModerate

Show DOMAIN details

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
showdomaindetails

Problem

Showing the columns and constrains of a table in PostgreSQL is done with:

\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 psql

\dD[S+] [PATTERN]      list domains


You 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 domains

Context

StackExchange Database Administrators Q#73642, answer score: 11

Revisions (0)

No revisions yet.