Re: Does psycopg2 support Kerberos for Postgres? - Mailing list psycopg

From Adrian Klaver
Subject Re: Does psycopg2 support Kerberos for Postgres?
Date
Msg-id 87ab9d56-392b-0cd0-c39a-79c61935815c@aklaver.com
Whole thread Raw
In response to Does psycopg2 support Kerberos for Postgres?  (Yang Gao <Yang.Gao@twosigma.com>)
List psycopg
On 12/06/2016 10:09 AM, Yang Gao wrote:
> Got it, so psycopq uses the Postgres c-lib directly.

FYI as of 09.05.0100 so does psqlodbc:

https://odbc.postgresql.org/docs/release.html
psqlODBC 09.05.0100 Release
Changes:

     Use libpq for all communication with the server
     Previously, libpq was only used for authentication. Using it for
all communication lets us remove a lot of duplicated code. libpq is now
required for building or using libpq.

Still they serve two different roles, psycopg2 as Python binding to
libpq and psqlodbc as ODBC driver.

Then, what is the recommended way of managing libpq? Looks like when I
installed psycopq from PyPi, it also pulled down this dependency which
has no Kerberos support. Is there better way to overwrite this
dependency rather than manually swap it out?

Build psycopg2 from source and point it at the pg_config for the GSSAPI
server?

The ? because of this:

http://initd.org/psycopg/docs/install.html#install-from-source
"

Note

The libpq header files used to compile psycopg2 should match the version
of the library linked at runtime. If you get errors about missing or
mismatching libraries when importing psycopg2 check (e.g. using ldd) if
the module psycopg2/_psycopg.so is linked to the right libpq.so. "

Someone more versed in the build process then I will need to comment.

How did install the Postgres servers in question?


>
> Thanks.
>
> Yang
>
> -----Original Message-----
> From: Adrian Klaver [mailto:adrian.klaver@aklaver.com]
> Sent: Tuesday, December 06, 2016 12:15 PM
> To: Yang Gao; 'psycopg@postgresql.org'
> Subject: Re: [psycopg] Does psycopg2 support Kerberos for Postgres?
>
> On 12/06/2016 08:28 AM, Yang Gao wrote:
>> That's a very good question. I pulled out the 2 libqp libraries. One in the default python installation that my
psycopg2uses and the other used in my pyodbc experiment where Kerberos works. 
>> They are of the same name, but different builds. Looks like I was using a lib without Kerberos support!
>>
>> If I replace the lib with the Kerberos supporting one, everything starts to work.
>>
>> Thank you very much!
>>
>> A further question, does psycopg2 respect the unixODBC's odbcinst.ini and odbc.ini (didn't find it in
documentation)?Is there way to explicitly specify the driver library? 
>
> psycopg2 knows nothing about ODBC, so it will not look at those files.
>
> In other words psycopg2 != psqlodbc.
>
>>
>> Yang
>>


--
Adrian Klaver
adrian.klaver@aklaver.com


psycopg by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Does psycopg2 support Kerberos for Postgres?
Next
From: Yang Gao
Date:
Subject: Re: Does psycopg2 support Kerberos for Postgres?