Re: Changing the value of data_directory - Mailing list pgsql-novice

From Greg Sabino Mullane
Subject Re: Changing the value of data_directory
Date
Msg-id 3478f08b6c23b4aad636182c88b5a84d@biglumber.com
Whole thread Raw
In response to Changing the value of data_directory  ("Birchall, Austen" <austen.birchall@metoffice.gov.uk>)
Responses Re: Changing the value of data_directory
List pgsql-novice
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160


Austen Birchall wrote:
> postgres=# SHOW data_directory;
>  /var/lib/pgsql/data
...
> postgres=# SHOW data_directory;
 /var/lib/pgsql/9.4/data
...
> 1. How/when is the value of data_directory set - is it set as part of the install?

Yes. It is set when Postgres starts up, and cannot be changed without a restart. The value
can be hard-coded in your postgresql.conf file, but usually defaults to the PGDATA
environment variable, or the -D option to the 'postgres' program.

> 2. Is it possible to change the value of data_directory without doing a frest install?

Yes. But I would be careful, it looks like you have may have two active clusters. I'd
document everything clearly before proceeding: use "show port" and
"show unix_socket_directories" to learn why you can connect to both clusters at the
same time, if that is the case.

- --
Greg Sabino Mullane greg@turnstep.com
End Point Corporation http://www.endpoint.com/
PGP Key: 0x14964AC8 201507270811
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAlW2JGgACgkQvJuQZxSWSsg70wCfYhpgJx5HdynM9OlLzTvuHCxr
oDwAoPevJBbQTc9Hw8ioHeKSnyUHTuhQ
=3KTG
-----END PGP SIGNATURE-----




pgsql-novice by date:

Previous
From: "Birchall, Austen"
Date:
Subject: Changing the value of data_directory
Next
From: Paul Linehan
Date:
Subject: Compiling PostgreSQL under Windows (for use with R package).