postgres.rst
changeset 2391 aedbd074ec54
parent 2388 4339ed4bd568
child 2392 eddb9a8153b5
equal deleted inserted replaced
2390:f2b450fa4f4b 2391:aedbd074ec54
   200 Current user::
   200 Current user::
   201 
   201 
   202   SELECT current_user;
   202   SELECT current_user;
   203   SELECT session_user;
   203   SELECT session_user;
   204 
   204 
   205 ::
   205 Active sessions and queries::
   206 
   206 
   207    select * from pg_stat_activity;
   207   select * from pg_stat_activity;
       
   208 
       
   209   select * from pg_stat_activity
       
   210   order by usename;
       
   211 
   208 
   212 
   209 https://www.postgresql.org/docs/current/monitoring-stats.html
   213 https://www.postgresql.org/docs/current/monitoring-stats.html
   210   The Statistics Collector.
   214   The Statistics Collector.
   211 
   215 
   212 Profile queries
   216 Profile queries
   247 
   251 
   248 To list all tables in the current database::
   252 To list all tables in the current database::
   249 
   253 
   250   \dt
   254   \dt
   251   SELECT table_schema, table_name FROM information_schema.tables ORDER BY table_schema, table_name;
   255   SELECT table_schema, table_name FROM information_schema.tables ORDER BY table_schema, table_name;
       
   256   SELECT * FROM pg_class;
   252 
   257 
   253 or in all schemas::
   258 or in all schemas::
   254 
   259 
   255   => \dt *.*
   260   => \dt *.*
   256 
   261