postmaster -- PostgreSQL multiuser database server

posted Feb 19, 2012, 6:40 PM by Sachchida Ojha
postmaster is the PostgreSQL multiuser database server. In order for a client application to access a database it connects (over a network or locally) to a running postmaster. The postmaster then starts a separate server process ("postgres") to handle the connection. The postmaster also manages the communication among server processes.

[root@usha data]# ls -l
total 92
drwx------. 5 postgres postgres  4096 Feb 19 13:00 base
drwx------. 2 postgres postgres  4096 Feb 19 21:14 global
drwx------. 2 postgres postgres  4096 Feb 19 13:00 pg_clog
-rw-------. 1 postgres postgres  4232 Feb 19 13:00 pg_hba.conf
-rw-------. 1 postgres postgres  1636 Feb 19 13:00 pg_ident.conf
drwx------. 2 postgres postgres  4096 Feb 19 13:30 pg_log
drwx------. 4 postgres postgres  4096 Feb 19 13:00 pg_multixact
drwx------. 2 postgres postgres  4096 Feb 19 13:30 pg_notify
drwx------. 2 postgres postgres  4096 Feb 19 13:00 pg_serial
drwx------. 2 postgres postgres  4096 Feb 19 21:33 pg_stat_tmp
drwx------. 2 postgres postgres  4096 Feb 19 13:00 pg_subtrans
drwx------. 2 postgres postgres  4096 Feb 19 13:00 pg_tblspc
drwx------. 2 postgres postgres  4096 Feb 19 13:00 pg_twophase
-rw-------. 1 postgres postgres     4 Feb 19 13:00 PG_VERSION
drwx------. 3 postgres postgres  4096 Feb 19 13:00 pg_xlog
-rw-------. 1 postgres postgres 19146 Feb 19 13:00 postgresql.conf
-rw-------. 1 postgres postgres    71 Feb 19 13:30 postmaster.opts
-rw-------. 1 postgres postgres    81 Feb 19 13:30 postmaster.pid
[root@usha data]# cat postmaster.pid
11987
/var/lib/pgsql/9.1/data
1329676222
5432
/tmp
localhost
  5432001  48234497
[root@usha data]#

Synopsis

postmaster [-A 0 | 1 ] [-B nbuffers] [-c name=value] [-d debug-level] [-D datadir] [-F] [-h hostname] [-i] [-k directory] [-l] [-N max-connections] [-o extra-options] [-p port] [-S] [--name=value] [-n | -s]

By default the postmaster starts in the foreground and prints log messages to the standard error stream. In practical applications the postmaster should be started as a background process, perhaps at boot time.

One postmaster always manages the data from exactly one database cluster. A database cluster is a collection of databases that is stored at a common file system location (the "data area"). More than one postmaster process can run on a system at one time, so long as they use different data areas and different communication ports (see below). A data area is created with initdb.

When the postmaster starts it needs to know the location of the data area. The location must be specified by the -D option or the PGDATA environment variable; there is no default. Typically, -D or PGDATA points directly to the data area directory created by initdb.
Options



Comments