PostgreSQL Configuration – Understanding postmaster.opts in PostgreSQL 9.3

postgresql

I am using PostgreSQL 9.3, but the book I am reading "Beginning Databases with PostgreSQL From Novice to Professional" is using PostgreSQL 8. It mentions there is a postmaster.opts file which passes the default flags to the postmaster executable. For example, it allows you to set the -D flag (t set location to data directory) and an -i flag (to enable network connections) and so forth. Well, I am running Ubuntu 14.04 and I cannot find this file anywhere. Has it disappeared in PostgreSQL 9 and if so, what has replaced it?

Best Answer

I have recently installed postgresql 9.4 from source

[pol@localhost inst]$ ./bin/psql --version
psql (PostgreSQL) 9.4.0
[pol@localhost inst]$ 

My install directory structure is as follows

/home/pol/Downloads/software/postgres/inst
[pol@localhost inst]$ ll
total 128
drwxrwxr-x.  2 pol pol  4096 Jan 29 05:42 bin
drwx------. 18 pol pol  4096 May  1 18:03 data
drwxrwxr-x.  6 pol pol  4096 Jan 29 05:42 include
-rw-r--r--.  1 pol pol 75392 Jan 29 05:44 INSTALL
-rw-rw-r--.  1 pol pol   158 Jan 29 05:45 install.txt
drwxrwxr-x.  4 pol pol  4096 Jan 29 05:42 lib
-rw-------.  1 pol pol 14718 May  2 17:47 logfile
-rw-rw-r--.  1 pol pol  2981 Jan 30 07:49 logfile.txt
-rw-rw-r--.  1 pol pol  5996 Apr  2 22:32 mytestdb.sql
drwxrwxr-x.  6 pol pol  4096 Jan 29 05:42 share

Then I searched for files name xxxx.opts

[pol@localhost inst]$ find . -name *.opts
./data/postmaster.opts

So, it exists in 9.4 - it appears from Googling that it generally lives in the data directory. I have never edited it manually.

[pol@localhost inst]$ more ./data/postmaster.opts 
/home/pol/Downloads/software/postgres/inst/bin/postgres "-D" "./data"
[pol@localhost inst]$

So, it appears that it still has a function in the system.