Forum OpenACS Q&A: Re: wrong PATH for postgres following installation doc -PLS HLP
Isn't it only _wrong_ until you have two versions of postgresql running? I liked your suggestion when you made it a while ago for Oracle install, but then I immediately installed two different copies of pg.
It seems that if you want to get technical about things, environment variables should be set per process, whenever a process is started up, or restarted.
Clients using one instance or another source the appropriate script. Your only decision to make, is if one instance should be the default - if so, source that instance's profile-postgres.sh from /etc/profile, and not the other. If you don't want any default instance, then source neither script from /etc/profile - now in order to use the database, each client must take a explicit action. But that action is just sourcing the script. This is way I said to put the settings into profile-postgres.sh, not directly into /etc/profile.
Having two instances changes nothing important - these are still system-wide settings that should be in a system-wide place. What you want to avoid is having the exact same settings hard-coded into lots of different places - put each in one place only, whenever feasible.