The questions are:
1. Has var expansion in configuration files been contemplated?
1. Has var expansion in configuration files been contemplated?
2. Why not do it?
So the presumed workflow is that:
1. There is no support for environment variable expansion in configuration files
2. Use of environment variable values should only be passed to the "postgres" on the command line
3. Ie thus passed through to pg_ctl from the OS init scripts.
Reasons why it's perhaps useful to change the presumed workflow:
Proposed workflow:
1. Environment
initialization, meaning the declaration of environment variables (in the
sense that "env -i" is probably spawned in the OS specific scripts and
is thus quite empty) for "pg_ctl" should be done in a postgresql
specific shell file.On the other hand:
1. One could just generate the conf files
2. Assign env vars to absolute paths/symbolic links
On Sat, Nov 30, 2013 at 8:06 PM, Andrew Sullivan <ajs@xxxxxxxxxxxxxxx> wrote:
On top of what John Pierce says in the thread, I would very stronglyOn Sat, Nov 30, 2013 at 06:54:31PM -0500, imagenesis@xxxxxxxxx wrote:
> Is it possible to use environment variables in postgresql.conf and perhaps
> related configuration files?
>
> For example, I would like to use an env variable to specify the data
> directory.
urge you not to do this. It makes troubleshooting on failure
notoriously hard. Use the mechanisms the start-up files do, I
suggest.
That said, see section 18 of the manual -- in particular, 18.1.3 in
the 9.3 manual ("Other ways to set parameters"). I recommend against
all that on the basis of some somewhat painful experience, but you can
do it that way.
If you're determined to do it, I _strongly_ suggest using several
different postgres.conf files and then only using the config_file
parameter to control this. At least then you can look at what the
settings were when you have a crashed or otherwise troublesome system.
Best,
A
--
Andrew Sullivan
ajs@xxxxxxxxxxxxxxx
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general