Changing the location of the default data directory on PG 9.6.6 (CentOS 7)?

From: Robert Gordon <rgordon(at)onetechbeyond(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Changing the location of the default data directory on PG 9.6.6 (CentOS 7)?
Date: 2017-11-18 05:59:14
Message-ID: CY1PR11MB0377A48F42A84238EAC9665BBD2C0@CY1PR11MB0377.namprd11.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm trying to identify which postgresql.conf file I should be editing, in order to change the default database files location for Postgres 9.6.6, when installed on CentOS 7.x/

Is the bet method for changing the default data directory at the time of database init, to include the $PGDATA variable at initialization, such as:

su - postgres -c '/usr/pgsql-9.6/bin/initdb --pgdata=$PGDATA', where $PGDATA is the directory path that I want the psql database files to reside?

Browse pgsql-general by date

  From Date Subject
Next Message Matt Zagrabelny 2017-11-18 17:50:10 Re: mild modification to pg_dump
Previous Message Andres Freund 2017-11-17 23:38:41 Re: mild modification to pg_dump