@
archives

PostgreSQL

This category contains 2 posts

Get the PostgreSQL Database and Schema Size

To get the Database Size, execute this query: postgres=# SELECT pg_database.datname, pg_size_pretty(pg_database_size(pg_database.datname)) AS size from pg_database; datname | size ————————+——— template1 | 6329 kB template0 | 6089 kB postgres | 6449 kB gcc_dashboard | 7649 kB ep | 213 MB ces_payroll | 2684 MB l2s_acctg | 6720 MB l2s_encrypted | 11 GB ces_live_final20101205 | 2723 … Continue reading

Getting PostgreSQL server’s start time and uptime

To get the start time, execute the query below: psql -c “SELECT pg_postmaster_start_time();” To get the uptime, execute the query below: psql -c “SELECT now() – pg_postmaster_start_time();”