Putting some of those environment variables in the postgres's users
login scripts is just plain
wrong anyway. As I've mentioned
before, these are system-wide settings that you probably want be
default in some system-wide place. See my
Oracle install notes
- the issue should be the same for PostgreSQL.
What you really want is a file called
/etc/profile-postgres.sh
or something like that. It
should be something like this:
#
# $Id: profile-postgres.sh,v 1.2 2002/12/24 07:03:13 atp Exp $
#
# Single central place for setting all PostgreSQL environment variables.
# Source this from /etc/profile.
#
# --atp@piskorski.com, 2002/12/06 14:03 EST
# For Debian PostgreSQL package:
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/postgresql/lib/
PATH=$PATH:/usr/lib/postgresql/bin/
PG_HEADERS=/usr/include/postgresql
## For locally installed from source PostgreSQL:
#LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/pgsql/lib
#PATH=$PATH:/usr/local/pgsql/bin
export PATH LD_LIBRARY_PATH PG_HEADERS
. /etc/postgresql/postgresql.env
Then do this in an appropriate spot in your system-wide
/etc/profile
:
for script in /etc/profile-oracle.sh /etc/profile-postgres.sh
do
if [ -e "$script" ]
then
. "$script"
fi
done