July 2005
Intermediate to advanced
1032 pages
27h 10m
English
When you create a table, PostgreSQL stores the definition of that table in the system catalog. The system catalog is a collection of PostgreSQL tables. You can issue SELECT statements against the system catalog tables just like any other table, but there are easier ways to view table and index definitions.
When you are using the psql client application, you can view the list of tables defined in your database using the \d meta-command:
movies=# \d
List of relations
Name | Type | Owner
------------------+-------+---------------
customers | table | bruce
rentals | table | bruce
tapes | table | bruce
To see the detailed definition of a particular table, use the \d table-name meta-command:
movies=# ...
Read now
Unlock full access