How do you say "show tables" (mysql) in Postgresql?
+10
A:
From the psql
CLI, enter the \dt
command. Programmatically (or from the psql
interface too, of course),
SELECT * FROM pg_catalog.pg_tables
(the system tables live in the pg_catalog database.)
Mihai Limbășan
2009-04-20 19:12:57
A:
Moocha's answer is correct. Alternatively, you can use the pgadmin3 gui admin tool, or pgphpadmin.
Dana the Sane
2009-04-20 19:22:49
+5
A:
(For completeness)
You could also query the (SQL-standard) information schema:
SELECT
table_schema || '.' || table_name
FROM
information_schema.tables
WHERE
table_type = 'BASE TABLE'
AND
table_schema NOT IN ('pg_catalog', 'information_schema');
Milen A. Radev
2009-04-21 09:55:03