PGDATA / data_directory

Started by Benoit Lobréauover 9 years ago4 messagesgeneral
Jump to latest
#1Benoit Lobréau
blo.capdata@gmail.com

Hi,

My company is using PGDATA to store configuration files and the guc
data_directory to give the path to the instance directory.

They would use it like this:

pg_ctl start -D <path to CONFDIR> -w

with this directory setup:

<somepath>/CONFDIR => postgresql.conf pg_hba.conf pg_ident.conf
<somepath>/SYSTEM => All the normal stuff in the postgres instance
directory + recovery.conf recovery.done etc...

Is it commonly used ?

Thanks for your help / remarks / feedback.

Benoit.

#2Christoph Berg
myon@debian.org
In reply to: Benoit Lobréau (#1)
Re: PGDATA / data_directory

Re: Benoit Lobr�au 2016-08-31 <CAPE8EZ6ToyA=MMzL7Z-dyhhXhrtuAOgOd6we=cxjhTNd7JdiWA@mail.gmail.com>

Hi,

My company is using PGDATA to store configuration files and the guc
data_directory to give the path to the instance directory.

They would use it like this:

pg_ctl start -D <path to CONFDIR> -w

with this directory setup:

<somepath>/CONFDIR => postgresql.conf pg_hba.conf pg_ident.conf
<somepath>/SYSTEM => All the normal stuff in the postgres instance
directory + recovery.conf recovery.done etc...

Is it commonly used ?

That's the default cluster layout on Debian (and Debian-based
distributions).

/etc/postgresql/9.5/main/
/var/lib/postgresql/9.5/main/
/var/run/postgresql/9.5-main.pg_stat_tmp/

Christoph

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

In reply to: Christoph Berg (#2)
Re: PGDATA / data_directory

On Sun, 4 Sep 2016 11:40:38 +0200
Christoph Berg <myon@debian.org> wrote:

Re: Benoit Lobréau 2016-08-31
<CAPE8EZ6ToyA=MMzL7Z-dyhhXhrtuAOgOd6we=cxjhTNd7JdiWA@mail.gmail.com>

Hi,

My company is using PGDATA to store configuration files and the guc
data_directory to give the path to the instance directory.

They would use it like this:

pg_ctl start -D <path to CONFDIR> -w

with this directory setup:

<somepath>/CONFDIR => postgresql.conf pg_hba.conf pg_ident.conf
<somepath>/SYSTEM => All the normal stuff in the postgres instance
directory + recovery.conf recovery.done etc...

Is it commonly used ?

That's the default cluster layout on Debian (and Debian-based
distributions).

/etc/postgresql/9.5/main/
/var/lib/postgresql/9.5/main/
/var/run/postgresql/9.5-main.pg_stat_tmp/

Indeed. I never noticed data_directory was set in postgresql.conf file...

But then, why starting PostgreSQL with the following command ?

/usr/lib/postgresql/9.4/bin/postgres -D /var/lib/postgresql/9.4/main \
-c config_file=/etc/postgresql/9.4/main/postgresql.conf

It seems the following one work as expected and seems more logical with this
setup:

/usr/lib/postgresql/9.4/bin/postgres -D /etc/postgresql/9.4/main/

--
Jehan-Guillaume de Rorthais

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

#4Christoph Berg
myon@debian.org
In reply to: Jehan-Guillaume (ioguix) de Rorthais (#3)
Re: PGDATA / data_directory

Re: Jehan-Guillaume de Rorthais 2016-09-07 <20160907140816.3e13eaa3@firost>

Indeed. I never noticed data_directory was set in postgresql.conf file...

But then, why starting PostgreSQL with the following command ?

/usr/lib/postgresql/9.4/bin/postgres -D /var/lib/postgresql/9.4/main \
-c config_file=/etc/postgresql/9.4/main/postgresql.conf

It seems the following one work as expected and seems more logical with this
setup:

/usr/lib/postgresql/9.4/bin/postgres -D /etc/postgresql/9.4/main/

TBH, I've been wondering about that myself, but never bothered to to
anything about it. Digging in the (now git) history, it's been like
that from the very beginning in 2005:

https://anonscm.debian.org/cgit/pkg-postgresql/postgresql-common.git/commit/?id=9fa563e78366db3b27d680607c202b6fbb00bef2

It got touched a bit when 8.0 support was added, but basically not
changed since then.

https://anonscm.debian.org/cgit/pkg-postgresql/postgresql-common.git/commit/?id=fecbaad06c3683452228d31c0baffb01ba626a9a

I'll see if I can simply remove it. Thanks for the suggestion.

Christoph

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