Find database creation date

We cannot find it directly but we can check attributes of directories which contain data files of each database. In PostgreSQL you can try this query: with mydir as (select setting||'/base' as _dir from pg_settings where name = 'data_directory'), mydbs as (select oid...

Log all queries into server log

To log all queries which are processed on PostgreSQL 8.4 or 9.3 server you have to enable / add / change these lines in your postgresql.conf file: log_statement = all log_min_error_statement = error log_min_duration_statement = 0   useful is also: log_line_prefix...

How to check PostgreSQL processes from OS

On Linux: ps-ef |greppostgres | grep-v grep shows all postgres processes works on all Linux distros second grep pipe just filters out line with “grep postgres” command   you will see something like this – of course directories can be...

Server statistics

If you need to see some more humanly readable and comprehensible server statistics like deleted records etc try this. It shows numbers for all databases on server: select datname as database, pg_stat_get_db_numbackends(oid) as "Number of active server processes...

bgwriter statistic in PostgreSQL 8.4

If you need to check what is PostgreSQL really doing – reads, writes, etc. you can try bgwriter statistic in pg_stat_bgwriter Only problem is that PG 8.4 does not store history therefore you need to save some time snapshots. First – create table for time...