When there are multiple versions of postgresql-base installed, 'eselect postgresql set' is supposed to select which version is active. For the most part this works OK, but it does not correctly handle setting the library path. The problem is that /etc/env.d/ contains files 50postgresql-94-maj.min for each installed version, and each of these sets the LDPATH to its version of the library directory. This results in applications (other than those which are part of postgresql, which have the appropriate rpath set) loading the lowest installed version at runtime. 'eselect postgresql set' should ensure that only the correct version's library directory is on the loader path.
Please review app-admin/eselect-postgresql-1.0.3. It should address this issue.
*** Bug 359989 has been marked as a duplicate of this bug. ***
*** Bug 360043 has been marked as a duplicate of this bug. ***
*** This bug has been marked as a duplicate of bug 352147 ***