Re: PGDATA / data_directory

From: Jehan-Guillaume de Rorthais <ioguix(at)free(dot)fr>
To: Christoph Berg <myon(at)debian(dot)org>
Cc: Benoit Lobréau <blo(dot)capdata(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: PGDATA / data_directory
Date: 2016-09-07 12:08:16
Message-ID: 20160907140816.3e13eaa3@firost
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 4 Sep 2016 11:40:38 +0200
Christoph Berg <myon(at)debian(dot)org> wrote:

> Re: Benoit Lobréau 2016-08-31
> <CAPE8EZ6ToyA=MMzL7Z-dyhhXhrtuAOgOd6we=cxjhTNd7JdiWA(at)mail(dot)gmail(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Farber 2016-09-07 13:05:38 Passing varchar parameter to INTERVAL
Previous Message Martijn Tonies (Upscene Productions) 2016-09-07 06:29:37 Re: pgadmin4 rc1 query tool performance