pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: kyle.sletmoe@elementaltechnologies.com
To: pgsql-bugs@postgresql.org
Subject: BUG #12801: data_directory postgresql.conf setting is not honored on Centos 6.6
Date: Tue, 24 Feb 2015 22:52:35 +0000
Message-ID: <20150224225235.2529.87182@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      12801
Logged by:          Kyle Sletmoe
Email address:      kyle.sletmoe@elementaltechnologies.com
PostgreSQL version: 9.3.6
Operating system:   Centos 6.6
Description:        

According to
http://www.postgresql.org/docs/9.3/static/runtime-config-file-locations.html,
I should be able to put my configuration files (postgresql.conf,
pg_hba.conf, pg_ident.conf) in a different directory than my data directory,
as long as I set the PGDATA environment variable to the directory that
contains postgresql.conf and then set the data_directory variable in
postgresql.conf to point to the directory that actually contains the
postgres data. To configure this, I did a fresh install of PostgreSQL 9.3.6
on a Centos 6.5 (x64) machine, following the instructions here:
https://wiki.postgresql.org/wiki/YUM_Installation. I created a directory for
the data ('/data/pgsql/data') and one for configuration
('/data/pgsql/config'). I then ran `su postgres -c
'/usr/pgsql-9.3/bin/initdb -D /data/pgsql/data'`, and then moved the .conf
files out of /data/pgsql/data into /data/pgsql/config. I then modified
postgresql.conf, setting "data_directory = '/data/pgsql/data'", "pg_file =
'/data/pgsql/config/pg_hba.conf'", and "ident_file =
'/data/pgsql/config/pg_ident.conf'". Lastly, I updated
/etc/sysconfig/pgsql/postgresql-9.3 to include "export
PGDATA=/data/pgsql/config". When I ran `sudo service postgresql-9.3 start`,
I got this error message: '/data/pgsql/config is missing. Use "service
postgresql-9.3 initdb" to initialize the cluster first.'. I looked at the
postgres init script ('/etc/init.d/postgresql-9.3') and noticed this message
will be emitted if this bash statement results in false: "if [ -f
"$PGDATA/PG_VERSION" ] && [ -d "$PGDATA/base" ]". $PGDATA in this context is
config directory like we set above in the
/etc/sysconfig/pgsql/postgresql-9.3 file. The init script needs to check the
value of data_directory in postgresql.conf in order to see if the data in
the data directory is valid.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



Message-ID: <20150224225235.2529.87182@wrigleys.postgresql.org>
Permalink:  ../20150224225235.2529.87182@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20150224225235.2529.87182@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: kyle.sletmoe@elementaltechnologies.com
  Subject: Re: BUG #12801: data_directory postgresql.conf setting is not honored on Centos 6.6
  In-Reply-To: <20150224225235.2529.87182@wrigleys.postgresql.org>
  References: <20150224225235.2529.87182@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox