How to check database and database owner information on psql

 How to check database and database owner information on psql:


 You can check with \list command 


example:


testsub=> \list

                                             List of databases

      Name      |   Owner   | Encoding |     Collate     |      Ctype      |       Access privileges

----------------+-----------+----------+-----------------+-----------------+--------------------------------

 testdb             | testuser | UTF8     | en_US.UTF-8     | en_US.UTF-8     |


How to check connected user on psql

 

How to check connected user on psql :

\conninfo


example:

testsub=> \conninfo

You are connected to database "testsub" as user "sub" on host "localhost" (address "127.0.0.1") at port "5432".


View running queries in postgresql

 View running queries in postgreSQL: SELECT * FROM pg_stat_activity;