Re: pg_config, pg_service.conf, postgresql.conf ....

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Mark Woodward <pgsql(at)mohawksoft(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, josh(at)agliodbs(dot)com, pgsql-hackers(at)postgresql(dot)org, Martijn van Oosterhout <kleptog(at)svana(dot)org>
Subject: Re: pg_config, pg_service.conf, postgresql.conf ....
Date: 2006-02-28 12:50:24
Message-ID: 20060228125024.GA4425@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Nikolay Samokhvalov 2006-02-28 13:11:50 Re: Sequences/defaults and pg_dump
Previous Message Albe Laurenz 2006-02-28 12:41:09 Re: new feature: LDAP database name resolution