To query these metrics, you must be logged into PostgreSQL as a user that has read access to pg_stat_database
- Check version of PostgreSQL:
SELECT version();
- Show location of postgresql.conf file (requires superuser privileges):
SHOW config_file;
- Show location of data directory (requires superuser privileges):
SHOW data_directory;
- Show location of log directory (may be a path relative to data directory, requires superuser privileges):
SHOW log_directory;