How to show tables in PostgreSQL is a common question for beginners. In this article we will discuss showing tables in PostgreSQL.

In PostgreSQL all information about DB objects stored under information_schema.

You can use information_schema.tables table to list and show tables. A simple query to list all tables and schemas:

select table_schema, table_name from information_schema.tables;

If you want to list all tables under a schema (testschema in this case) you can use the following query:

select table_schema, table_name from information_schema.tables where table_schema='testschema';

information_schema is a very informative schema for PostgreSQL. You can find tables, schemas, triggers, role and all kind of object definitions under information_schema.

There isn’t any shortcuts to list tables in PostgreSQL, but you can use queries above to list tables.

If you a comment, or something to add please leave comment below.

A new post everyday, subscribe now and don’t miss it!

Subscribe to our newsletter for cool news

Hi! I’m an IT Specialist

I want to hear from you! I am Working with enterprises for 10+ years to improve their infrastructure and efficiency.

Get in touch with me.

Leave a Reply

Discover more from Empower. Innovate. Transform.

Subscribe now to keep reading and get access to the full archive.

Continue reading