Check the database, schema , views, tables, users & roles in PostgreSQL
Check the database present in the PostgreSQL:
\l
Check the list of tables present in the PostgreSQL:
\dt
Example:
testdb=# \dt
List of relations
Schema | Name | Type | Owner
--------+------+-------+----------
public | test | table | postgres
(1 row)
Check the views present in the PostgreSQL:
\dv
Check the list of function present in the PostgrSQL:
\df
Check the list of schemas present in the PostgrSQL:
\dn
Example:
testdb=# \dn
List of schemas
Name | Owner
--------+-------------------
public | pg_database_owner
(1 row)
Check the list of user present in the PostgreSQL:
\du
Example:
postgres=# \du
List of roles
Role name | Attributes | Member of
-----------+------------------------------------------------------------+-----------
postgres | Superuser, Create role, Create DB, Replication, Bypass RLS | {}