Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Mark Woodward wrote:

> 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

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                      
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group