Why does PostgreSQL's \dt show only public schema tables?

Postgresql

Postgresql Problem Overview


I have created a new schema in my PostgreSQl database with psql:

CREATE SCHEMA my_schema;

But when I issue the \dt command, I see only the tables that are in the public schema. However, I can access all the tables in my_schema with my_schema.table_name.

How can I see all the tables from all the schemas in psql?

Postgresql Solutions


Solution 1 - Postgresql

For your schema (note the period after the schema name):

\dt my_schema.

Or:

SET search_path TO my_schema, public;
\dt

For all schemas:

\dt *.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionskanatekView Question on Stackoverflow
Solution 1 - PostgresqlAlex HowanskyView Answer on Stackoverflow