Re: pg_config, pg_service.conf, postgresql.conf .... - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: pg_config, pg_service.conf, postgresql.conf ....
Date
Msg-id 20060228125024.GA4425@surnet.cl
Whole thread Raw
In response to Re: pg_config, pg_service.conf, postgresql.conf ....  ("Mark Woodward" <pgsql@mohawksoft.com>)
List pgsql-hackers
Mark Woodward wrote:

> [TOMLANE]
> DATADIR=/vol03/pg74
> PORT=5433
> POSTMASTER=/usr/local/pg7.4.1/bin/postmaster

Seems better to me to specify PREFIX (the --prefix arg to configure)
instead of POSTMASTER, because then you can search any needed executable
there (pg_config for example).  Or maybe use it to set PATH,
LD_LIBRARY_PATH, etc.  This PREFIX would be possibly superseded for
particular variables with EXEC_PREFIX or the other --*dir args to
configure.

OTOH it would also be nice to have the program have a mode to emit shell
variable declarations.  I have a nice little shell script that does that
(among many other things):

$ runpg 00orig  
export
PATH=/pgsql/install/00orig/bin:/home/alvherre/bin:/sbin:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
export PGDATA=/pgsql/install/00orig/data
export PGPORT=55432
export PGLIBS=/pgsql/install/00orig/lib
export PGINCLUDE=/pgsql/install/00orig/include

So I can run it like so:
`runpg 00orig`

And it will define those variables for the current shell.  (00orig is
what I call my unmodified CVS HEAD tree).

My script doesn't depend on a config file though -- it knows what
"installations" exist by poking the contents of a predefined directory.
But it's capable of following symlinks, so there's no need for a config
file really; just make a symlink pointing to the basedir into the
"runpg root dir" and voilà.

(Throwing out ideas in case something is useful ... I can share the
script if there's any interest.)

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: new feature: LDAP database name resolution
Next
From: Andreas Pflug
Date:
Subject: Re: new feature: LDAP database name resolution