Difference between revisions of "PostgreSQL: \dt"

From wikieduonline
Jump to navigation Jump to search
Line 20: Line 20:
 
== Related queries ==
 
== Related queries ==
  
* <code>[[SELECT tablename AS TABLE FROM pg_tables WHERE schemaname = 'public';]]</code>
+
* <code>[[SELECT tablename AS TABLE FROM pg_tables WHERE schemaname = 'public';]]</code> <ref>https://tableplus.com/blog/2018/07/postgresql-how-to-list-all-tables-excluding-views.html</ref>
 
* <code>[[SELECT * FROM information_schema.tables;]]</code>
 
* <code>[[SELECT * FROM information_schema.tables;]]</code>
 
  
 
== Related ==
 
== Related ==

Revision as of 09:40, 29 October 2021

https://www.postgresql.org/docs/current/app-psql.html


\dt
                           List of relations
 Schema |               Name                | Type  |       Owner
--------+-----------------------------------+-------+-------------------
 public | yourtable1                            | table | rds_master
 public | yourtable2                            | table | rds_master
 public | yourtable3                            | table | other_user
 public | yourtable4                            | table | rds_master


\dt *.*: List tables from all schemas (if *.* is omitted will only show SEARCH_PATH ones) [1]


\dE[S+]: List all foreign tables [2]

Related queries

Related

See also

  • https://gist.github.com/Kartones/dd3ff5ec5ea238d4c546
  • https://gist.github.com/Kartones/dd3ff5ec5ea238d4c546
  • https://tableplus.com/blog/2018/07/postgresql-how-to-list-all-tables-excluding-views.html
  • Advertising: