How can I tell/specify which version of the postgres client/libs psycopg2 is using?
<p>I have psycopg2 for a python program, but the computer the program is running on has two version of postgres installed: 9.2 in the 'main' system, and 9.5 in /opt. The postgres DB is hosted elsewhere, and is 9.5. The 9.2 psql client will still happily connect to the 9.5 DB, with a warning. How can I tell which version or postgres the psycopg2 library is using, and how can I force it to use a specific version? Running <code>SELECT version();</code> seems to return the server version, while I'm only interested in the client version.</p>

<p>In psycopg 2.6.x <code>ldd</code> is the way to go. In 2.7 there will be a function to return that information, but it's not been released yet.</p>

python postgresql psycopg2