memo for postgre
path (from homebrew)
-
log file: /opt/homebrew/var/log/postgresql@14.log
-
lock file: /opt/homebrew/var/postgresql@14/postmaster.pid
-
config file: /opt/homebrew/var/postgresql@14/postgresql.conf
sql statement
- back up table
CREATE TABLE {table name for backup} AS (SELECT * FROM {table name to be backuped})
postgresql meta data
- path where data is stored
SHOW data_directory;
- meta data for each database in postgresql
the oid of the table is mapped with directory name.
SELECT * FROM pg_database;
- meta data of index, sequence, primary key
SELECT * FROM pg_class;