PostgreSQL administration

Monitor PostgreSQL, manage sessions, run SQL, and create users and databases.

PostgreSQL databases have an administration screen with four tabs. Session and query details are available to the database owner and administrators.

  • Monitoring — connections, transaction rate, cache hit ratio, lock waits, deadlocks, long-running queries and transactions, database size, replication lag and active alerts. Test connection checks it is reachable.
  • Sessions — every client session. Terminate session disconnects one. Turn on query insights to collect slow-query history.
  • Storage — the largest tables and their indexes.
  • SQL & admin — a SQL console, plus create or delete databases, create users, assign permissions and set connection limits.

SQL console

Queries run as the database administrator. Results are limited to 8 MB and 30 seconds, and you can copy or download them as CSV.

Because the console runs as the administrator, statements such as DROP or DELETE take effect immediately. Take a backup before making changes you might need to undo.

A user created here gets a generated password, which you can reveal in the database's Credentials section.

Example: check the database before diagnosing queries

  1. Run Test connection, then review Monitoring and Sessions for long-running work or lock waits.
  2. Open SQL & admin and run the read-only query below.
  3. Copy or download the results as CSV. Enable query insights when you need collected slow-query history.
SELECT current_database(), now();