Show all tables in postgresql
- Details Hits: 16784
For some time this is bugging me: we use MonAlisa as official monitoring tool and I sometimes want to query data in the database, but I don't remember the table names.
Mysql uses SHOW TABLES;
Postrgres: \d
Postgres: \dtIs for tables, indexes and sequences
Postgres: select * from pg_tables, pg_indexes, pg_trigger; Oracle-ish stuff.
The table I was searching for was monitor_ids;
mon_data=> \d
List of relations
Schema | Name | Type | Owner
--------+---------------------------+-------+----------
public | abping | table | mon_user
public | abping_aliases | table | mon_user
public | abping_aliases_extra | table | mon_user
public | action_states | table | mon_user
public | ban_farm | table | mon_user
public | ban_ip | table | mon_user
public | colors | table | mon_user
public | monitor_1w_obj | table | mon_user
public | monitor_1w_obj_backup_rrd | table | mon_user
public | monitor_1y_100min_1 | table | mon_user
public | monitor_1y_100min_10 | table | mon_user
public | monitor_1y_100min_11 | table | mon_user
public | monitor_1y_100min_2 | table | mon_user
public | monitor_1y_100min_3 | table | mon_user
public | monitor_1y_100min_4 | table | mon_user
public | monitor_1y_100min_5 | table | mon_user
public | monitor_1y_100min_6 | table | mon_user
public | monitor_1y_100min_7 | table | mon_user
public | monitor_1y_100min_8 | table | mon_user
public | monitor_1y_100min_9 | table | mon_user
public | monitor_1y_1min_1 | table | mon_user
public | monitor_1y_1min_10 | table | mon_user
public | monitor_1y_1min_11 | table | mon_user
public | monitor_1y_1min_2 | table | mon_user
public | monitor_1y_1min_3 | table | mon_user
public | monitor_1y_1min_4 | table | mon_user
public | monitor_1y_1min_5 | table | mon_user
public | monitor_1y_1min_6 | table | mon_user
public | monitor_1y_1min_7 | table | mon_user
public | monitor_1y_1min_8 | table | mon_user
public | monitor_1y_1min_9 | table | mon_user
public | monitor_ids | table | mon_user
public | monitor_n_conf | table | mon_user
public | monitor_tables | table | mon_user
public | monitor_tables_onlinetime | table | mon_user
public | saved_bprevdata | table | mon_user
(36 rows)