[CentOS] Postgres Config File (eg: PGDATA)

Thu Oct 4 07:29:58 UTC 2007
Ow Mun Heng <Ow.Mun.Heng at wdc.com>

On Tue, 2007-09-25 at 04:18 -0400, Marko A. Jennings wrote:
> On Tue, September 25, 2007 3:34 am, Ow Mun Heng wrote:
> > Hi guys,
> >
> > need some clarification on whether there is a config file sourced by the
> > init script to determine where PGDATA is located.
> >
> > Right now, it seems like it's not sourced from anywhere by located on
> > the init file itself.
> >
> > Appreciate if you guys can let me know if this is the correct place for
> > altering it.
> 
> Multiple instances of Postgres database will have separate init scripts. 
> The location of the config file for each init script is
> 
> /etc/sysconfig/pgsql/<init-script-name>
> 
> For example, for the default init script (/etc/init.d/postgresql) that
> gets installed with Postgres, the config file is
> /etc/sysconfig/pgsql/postgresql .  Although the /etc/sysconfig/pgsql
> directory gets created when Postgres is installed, you will not find any
> config files in it initially.  In order to change the default PGDATA
> (and/or PGPORT) values, you sill need to create appropriately named config
> file that will look like this:
> 
> PGDATA=/data/pg
> PGPORT=3456
> 

Missed the below in the 1st glance. Thanks for the pointer and sorry for
the lateness. I only re-started to look at this again now. (My test bed
was my laptop running gentoo)

# Override defaults from /etc/sysconfig/pgsql if file is present
[ -f /etc/sysconfig/pgsql/${NAME} ] && . /etc/sysconfig/pgsql/${NAME}

export PGDATA
export PGPORT