PostgreSQL seems to have an environment file that allows settings environment variables. On Linux (Kubuntu 11.10 in my case), it is located at e.g. /etc/postgresql/8.4/main/environment and empty by default, apart from a few helpful comments.
On Mac OSX Lion, the file does not seem to exist: I would expect it at e.g. /Library/PostgreSQL/9.0/data/ as that’s where all the other configuration files are, but it is not there – and if I create it, it does not seem to be used.
How can I set environment variables for the PostgreSQL server on Mac OSX ?
There is no standard way to specify environment variables for PostgreSQL, I assume that file is
Kubuntuspecific.What I did to ease my life was copying approach used by ORACLE:
/etc/pgtabfile on each server where I run PostgreSQL databases;/etc/pgtab;pgenvwhich based on the/etc/pgtabshows the menu of clusters (in case there’re more then just one) and initialize allPATHs and variables.It works on my MacBookPro and on all Linux and HP-UX based servers.