Professional Documents
Culture Documents
psql (9.4.5)
Type "help" for help.
postgres=#
DB uptime
postgres=# select date_trunc('second', current_timestamp -
pg_postmaster_start_time()) as uptime;
uptime
-----------------
5 days 09:13:12
(1 row)
postgres=#
postgres=#
Subdirectory Purpose
base Main data directory. Beneath this directory each database has its own
directory within which are the files for each database table or index.
global Database server catalog tables that are shared across all databases.
pg_clog Transaction status files.
pg_multixact Row-level lock status files
pg_subtrans Subtransaction status files
pg_tblspc Links to external tablespaces
pg_twophase "2-phase commit", or Prepared transaction status
pg_xlog Transaction log (or Write Ahead Log - WAL)
postgres-# \x
Expanded display is on.
postgres=#
postgres=# select * from pg_database;
-[ RECORD 1 ]-+-------------------------------
datname | template1
datdba | 10
encoding | 6
datcollate | en_US.UTF-8
datctype | en_US.UTF-8
datistemplate | t
datallowconn | t
datconnlimit | -1
datlastsysoid | 12998
datfrozenxid | 1801
datminmxid | 1
dattablespace | 1663
datacl | {=c/pgdb,pgdb=CTc/pgdb}
-[ RECORD 2 ]-+-------------------------------
amazon=#