This is my third article on getting Started.

After the installation is complete, take a look at what it has ~

  • Look at the directory in the environment variable
export PGHOME=/usr/local/pgsql/
export PGUSER=postgres
export PGPORT=5432
export PGDATA=/app/pgsql/data
export PGLOG=/app/pgsql/log/postgres.log
export PATH=$PGHOME/bin:$PATH:$HOME/bin
export LD_LIBRARY_PATH=$PGHOME/lib:$LD_LIBRARY_PATH
PATH=/usr/local/pgsql/bin:$PATH
export PATH
Copy the code

Software Installation Directory

/usr/local/pgsql/ is equivalent to the /app/oracle software installation directory. Some commands that can be executed by software such as PSQL and pg_ctl are in this directory.

[postgres@yuan ~]$ cd /usr/local/pgsql/ [postgres@yuan pgsql]$ ll total 16 drwxr-xr-x 2 root root 4096 Jul 9 17:54 bin drwxr-xr-x 6 root root 4096 Jul 9 17:54 include drwxr-xr-x 4 root root 4096 Jul 9 17:54 lib lrwxrwxrwx 1 root root 26 Jul 9 17:56 postgresql-12.4 -> /usr/local/postgresql-12.4 DRWXR -xr-x 6 root root 4096 Jul 9 17:54 share [postgres@yuan pgsql]$ cd bin [postgres@yuan bin]$ ll total 12348 -rwxr-xr-x 1 root root 73808 Jul 9 17:54 clusterdb -rwxr-xr-x 1 root root 73552 Jul 9 17:54 createdb -rwxr-xr-x 1 root root 78416 Jul 9 17:54 createuser -rwxr-xr-x 1 root root 68944 Jul 9 17:54 dropdb -rwxr-xr-x 1 root root 68920 Jul 9 17:54 dropuser -rwxr-xr-x 1 root root 975928 Jul 9 17:54 ecpg -rwxr-xr-x  1 root root 142520 Jul 9 17:54 initdb -rwxr-xr-x 1 root root 44344 Jul 9 17:54 pg_archivecleanup -rwxr-xr-x 1 root root  130528 Jul 9 17:54 pg_basebackup -rwxr-xr-x 1 root root 172512 Jul 9 17:54 pgbench -rwxr-xr-x 1 root root 66984 Jul 9 17:54 pg_checksums -rwxr-xr-x 1 root root 42880 Jul 9 17:54 pg_config -rwxr-xr-x 1 root root 61376 Jul 9 17:54 pg_controldata -rwxr-xr-x 1 root root 76888 Jul 9 17:54 pg_ctl -rwxr-xr-x 1 root root 422888 Jul 9 17:54 pg_dump -rwxr-xr-x 1 root root 109376 Jul 9 17:54 pg_dumpall -rwxr-xr-x 1 root root 73064 Jul 9 17:54 pg_isready -rwxr-xr-x 1 root root 93208 Jul 9 17:54 pg_receivewal -rwxr-xr-x 1 root root 93832 Jul 9 17:54 pg_recvlogical -rwxr-xr-x 1 root root  71256 Jul 9 17:54 pg_resetwal -rwxr-xr-x 1 root root 187840 Jul 9 17:54 pg_restore -rwxr-xr-x 1 root root 109784 Jul 9 17:54 pg_rewind -rwxr-xr-x 1 root root 49216 Jul 9 17:54 pg_test_fsync -rwxr-xr-x 1 root root 39152 Jul 9 17:54 pg_test_timing -rwxr-xr-x 1 root root 148952 Jul 9 17:54 pg_upgrade -rwxr-xr-x 1 root root 103904 Jul 9 17:54 pg_waldump  -rwxr-xr-x 1 root root 8227064 Jul 9 17:53 postgres lrwxrwxrwx 1 root root 8 Jul 9 17:53 postmaster -> postgres -rwxr-xr-x 1 root root 615376 Jul 9 17:54 psql -rwxr-xr-x 1 root root 78032 Jul 9 17:54 reindexdb -rwxr-xr-x 1 root root  86968 Jul 9 17:54 vacuumdbCopy the code

The data directory

/app/ PGSQL /data is equivalent to the data directory specified when oracle database is built. Parameter files and data files required by the database are all under this directory.

[postgres@yuan include]$ cd /app/pgsql/data [postgres@yuan data]$ ll total 60 drwx------ 5 postgres postgres 41 Jul 9 18:02 base drwx------ 2 postgres postgres 4096 Jul 9 18:06 global drwx------ 2 postgres postgres 6 Jul 9 18:02 pg_commit_ts drwx------ 2 postgres postgres 6 Jul 9 18:02 pg_dynshmem -rw------- 1 postgres postgres 4789 Jul 9 18:03 pg_hba.conf -rw------- 1 postgres postgres 1636 Jul 9 18:02 pg_ident.conf drwx------ 4 postgres postgres 68 Jul 9 18:10 pg_logical drwx------ 4 postgres postgres 36 Jul 9 18:02 pg_multixact drwx------ 2 postgres postgres 18 Jul 9 18:05 pg_notify drwx------ 2 postgres postgres 6 Jul 9 18:02 pg_replslot drwx------ 2 postgres postgres 6 Jul 9 18:02 pg_serial drwx------ 2 postgres postgres 6 Jul 9 18:02 pg_snapshots drwx------ 2 postgres postgres 6 Jul 9 18:02 pg_stat  drwx------ 2 postgres postgres 63 Jul 9 20:50 pg_stat_tmp drwx------ 2 postgres postgres 18 Jul 9 18:02 pg_subtrans drwx------ 2 postgres postgres 6 Jul 9 18:02 pg_tblspc drwx------ 2 postgres postgres 6 Jul 9 18:02 pg_twophase -rw------- 1 postgres postgres 3 Jul 9 18:02 PG_VERSION drwx------ 3 postgres postgres 60 Jul 9 18:02 pg_wal drwx------ 2 postgres postgres 18 Jul 9 18:02 pg_xact -rw------- 1 postgres postgres 88 Jul 9 18:02 postgresql.auto.conf -rw-------  1 postgres postgres 26659 Jul 9 18:03 postgresql.conf -rw------- 1 postgres postgres 53 Jul 9 18:05 postmaster.opts -rw------- 1 postgres postgres 74 Jul 9 18:05 postmaster.pidCopy the code

Description of Documents and contents:

  • Pg_hba. conf: authentication configuration file, which configures the IP addresses allowed to access the database and the authentication mode.
  • Pg_ident. conf: user mapping file for the IDENT authentication mode.
  • PG_VERSION: records the database version.
  • Postgresql.auto-. conf: has the same function as postgresql.conf and has a higher priority than postgresql.conf. Parameters changed by using the ALTER command are recorded in this file.
  • Postgresql. conf: the main configuration file for a database instance. This file contains almost all database parameters.
  • Postmaster. opts: records the database startup command.
  • Postmaster. pid: database process file. It is created when the database is started and disappears when the database is stopped.
  • Base: This directory contains the databases created by database users, as well as pg_Defaulttablespace for postgres, TEMPLate0, and template1.
  • Global: This directory contains cluster-wide tables and related views. (pg_database, pg_tablespace)
  • Pg_dynshmem: This directory contains files used by the dynamic shared memory subsystem.
  • Pg_commit_ts: the directory contains the time of committed transactions.
  • Pg_logical: This directory contains status data for logical decoding.
  • Pg_multixact: this directory contains multiple transaction status data. (Concurrent transactions waiting for locking)
  • Pg_notify: This directory contains the LISTEN/NOTIFY status data.
  • Pg_replslot: This directory contains replication slot data.
  • Pg_snapshots: indicates exported snapshots.
  • Pg_stat: This directory contains the permanent files of the statistics subsystem.
  • Pg_stat_tmp: this directory contains temporary files of the statistics subsystem.
  • Pg_subtrans: this directory contains subtransaction status data.
  • Pg_tblspc: This directory contains symbolic links for table Spaces.
  • Pg_twophase: this directory contains the status files of the prepared transactions.
  • Pg_wal: This directory contains WAL logs.
  • Pg_xact: This directory contains transaction commit status data.

Log directory

/app/ PGSQL /log/ Path is customized. You can configure various logs of the database. In this environment, only database startup and shutdown logs are configured.

[postgres@yuan log]$ cd /app/pgsql/log/
[postgres@yuan log]$ ll
total 4
-rw------- 1 postgres postgres 1006 Jul  9 21:21 postgres.log
Copy the code

At present, the above files are used less, especially some directories in the data directory, which have not been deeply understood, I will study it slowly. Huh? What is the happy Planet…