\dt [ PATTERN ]
The \dt [ PATTERN ]
meta-command (lowercase t) is identical to \d and returns all tables in the database—unless a table name is specified—in which case the command lists only the schema, name, kind and owner for the specified table (or tables if wildcards used).
vmartdb=> \dt inventory_fact List of tables Schema | Name | Kind | Owner --------+----------------+-------+--------- public | inventory_fact | table | dbadmin (1 row)
The following command returns all table names that begin with "st
":
vmartdb=> \dt st* List of tables Schema | Name | Kind | Owner --------+-------------------+-------+--------- store | store_dimension | table | dbadmin store | store_orders_fact | table | dbadmin store | store_sales_fact | table | dbadmin (3 rows)