How do I list the schema for a table or procedure?

Started by Google Mikeover 21 years ago2 messagesgeneral
Jump to latest
#1Google Mike
googlemike@hotpop.com

How do I list the schema for a table or procedure? Is there a command
I can do in psql to list this, or do I have to join a series of tables
to see that?

#2W. Scott Gibson
wsgibson@alltel.net
In reply to: Google Mike (#1)
Re: How do I list the schema for a table or procedure?

Google Mike wrote:

How do I list the schema for a table or procedure? Is there a command
I can do in psql to list this, or do I have to join a series of tables
to see that?

You can do a "pg_dump -s <DBNAME>" to see the full schema of the
database. To see just a table of the database issue the command
"pg_dump -st <TABLENAME> <DBNAME>". These are run from the command line
and not within the psql shell.

Within psql you could use "\d <TABLENAME>" to describe a specific table.