Difference between revisions of "PostgreSQL: \dt"

From wikieduonline
Jump to navigation Jump to search
Line 2: Line 2:
  
 
* https://www.postgresql.org/docs/current/app-psql.html
 
* https://www.postgresql.org/docs/current/app-psql.html
 +
 +
List tables from all [[schemas]] (if *.* is omitted will only <code>[[show SEARCH_PATH]]</code> ones)
 +
\dt *.*
 +
<ref>https://gist.github.com/Kartones/dd3ff5ec5ea238d4c546</ref>
  
  
Line 15: Line 19:
  
  
List tables from all [[schemas]] (if *.* is omitted will only <code>[[show SEARCH_PATH]]</code> ones)
 
\dt *.*
 
<ref>https://gist.github.com/Kartones/dd3ff5ec5ea238d4c546</ref>
 
  
 
  List all [[foreign tables]] <ref>https://gist.github.com/Kartones/dd3ff5ec5ea238d4c546</ref>
 
  List all [[foreign tables]] <ref>https://gist.github.com/Kartones/dd3ff5ec5ea238d4c546</ref>

Revision as of 08:41, 12 May 2022

List tables.

List tables from all schemas (if *.* is omitted will only show SEARCH_PATH ones)

\dt *.*

[1]


\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


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

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
  • https://tableplus.com/blog/2018/04/postgresql-how-to-list-all-tables.html
  • Advertising: