What is pg_class in Postgres and how to see it using pgAdmin 4?

8.7k Views Asked by At

I'm new to Postgresql and I just saw my friends query on a cakePhp controller that call 'pq_class'. I tried to look up to my PostgreSQL database and find out what's inside using pgAgmin4.

Unfortunately, I can't see any table name with 'pg_class'. I tried to google and find these pages :

https://www.postgresql.org/docs/current/catalog-pg-class.html

postgreSQL - pg_class question

But I am still confused about pg_class. Is there any good or real explanation about pg_class and how to see it using pgAdmin4 without using any query (just right click -> view data)

2

There are 2 best solutions below

0
On BEST ANSWER

pg_class is an internal system table that stores information about tables (and similar objects") available in the database. Every database product has such a collection of system tables (and views) that it maintains.

You can (and in most cases should) use the views from the information_schema if you want to see information about tables, columns, views and other database objects.

0
On

You can get details from information_schema on pgadmin like this.

` SELECT * FROM information_schema.columns;

select * from information_schema.tables`