PSQL: List Various Kinds Of Objects
Our PostgreSQL database can end up with all kinds of objects: tables, sequences,
views, etc. We can use a variety of psql meta-commands to list the different
types of (user-created) objects in our database.
-
\dtwill list all the tables -
\dEwill list all the foreign tables -
\diwill list all the indexes -
\dswill list all the sequences -
\dvwill list all the views -
\dmwill list all the materialized views
These can also be combined. For instance, to see all the tables and sequences,
we can run \dts.
Via jbranchaud/til.
Leave a comment