
Step 1: Open the Query Toolįirstly, open the pgAdmin and then right-click on the selected database and select the “Query Tool” as follows:Ĭlicking on the query tool will open the query editor as shown in the below screenshot: Step 2: Show Tables Using pg_catalog By default, the pg_catalog will show all the relations, including systems tables however, you can use the WHERE clause to filter the tables of your choice. In PostgreSQL, you can use the pg_catalog schema with the collaboration of the SELECT query to show the tables.

#Psql show tables how to
How to Show Tables in PostgreSQL Using pgAdmin? This is how you can show the tables using the SQL SHELL(psql). To show the tables with more details like table’s size, access method, description, etc., execute the “\dt+” command as follows: \dt+ Step 4: Show the Tables Details Using “\dt+” Command The output shows that there are total “18” tables in the “example” database. To see the available tables/relations within the example database, execute the “\dt” command as follows: \dt Step 3: Show the List of Tables Using “\dt” Command The command mentioned above will connect us to the “example” database:Ĭongratulations! You are connected to the desired database. Once you are logged in, specify the database name after the “\c” command to access the desired database: \c example Let’s open the psql tool and fill in the necessary details like user name, password, etc., to connect to the PostgreSQL: Step 2: Access the Database Using \c Command This section will present stepwise instructions to show the Postgres tables using psql: Step 1: Open psql To show tables using psql, the “\dt” command is used.

How to Show Tables in PostgreSQL Using SQL SHELL(psql)? Let’s learn how to show tables in PostgreSQL with the help of examples. Execute the “\dt” command from the psql tool or use the pg_catalog schema with the aid of the SELECT query from the pgAdmin to show tables of the selected database. In PostgreSQL, SQL SHELL (psql) and pg_catalog schema are used to show the tables.
