Re: Does psycopg2 support Kerberos for Postgres?

From: Yang Gao <Yang(dot)Gao(at)twosigma(dot)com>
To: 'Daniele Varrazzo' <daniele(dot)varrazzo(at)gmail(dot)com>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org>
Subject: Re: Does psycopg2 support Kerberos for Postgres?
Date: 2016-12-08 19:01:53
Message-ID: efb9efbaa8ad4bbfb4f721862c921852@exmbdft5.ad.twosigma.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

Hi, Daniele,

Thanks for pointing this out. You are absolutely right that conda installs libpq as a dependency of psycopg2.
In https://repo.continuum.io/pkgs/free/linux-64/psycopg2-2.6.2-py27_0.tar.bz2, the info/index.json as below contains a dependency to the latest libpq which does not have Kerberos support(https://repo.continuum.io/pkgs/free/linux-64/libpq-9.5.4-0.tar.bz2 ). However, this dependency does not exist for python3 builds such as psycopg2-2.6.2-py34_0.tar.bz2 and psycopg2-2.6.2-py35_0.tar.bz2. It actually makes sense as the shared libs are often specified by LD_LIBRARY_PATH. Would you agree?

Not sure who packages and uploads psycopg2 to the central conda repo, but it would be nice not to have the dependency declared for the python2.7 builds.

Thanks.

Yang

-----
Info/Index.json:

{
"arch": "x86_64",
"build": "py27_0",
"build_number": 0,
"depends": [
"libpq",
"openssl",
"python 2.7*"
],
"license": "LGPL, BSD-like, ZPL",
"license_family": "LGPL",
"name": "psycopg2",
"platform": "linux",
"subdir": "linux-64",
"version": "2.6.2"
}

-----Original Message-----
From: Daniele Varrazzo [mailto:daniele(dot)varrazzo(at)gmail(dot)com]
Sent: Tuesday, December 06, 2016 8:55 PM
To: Yang Gao
Cc: Adrian Klaver; psycopg(at)postgresql(dot)org
Subject: Re: [psycopg] Does psycopg2 support Kerberos for Postgres?

On Tue, Dec 6, 2016 at 6:09 PM, Yang Gao <Yang(dot)Gao(at)twosigma(dot)com> wrote:
> Got it, so psycopq uses the Postgres c-lib directly. 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?

No, installing psycopg2 from PyPI doesn't install the libpq: if not found already installed in the system it will give the dreaded error "pg_config" (well, it's sort of unrelated, but libpq and pg_config are regularly packaged together. If not you'd have a different error at build time).

I'm sorry I've jumping on the thread only now, and thank you very much for your support Adrian: I don't know much about kerberos support.

Yang, I see your libpq is at:
/home/yangg/.conda/envs/py2/lib/libpq.so.5.8, so ISTM you haven't installed psycopg from PyPI but from Conda. It seems Conda ships a libpq build without kerberos support: you may want to open a bug with them and ask for a more complete build. AFAICS the libpq version shipped with stock ubuntu does include kerberos, so 'apt-get install python-dev libpq-dev && pip install psycopg2' should actually work.

-- Daniele

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Adrian Klaver 2016-12-08 21:04:17 Re: Does psycopg2 support Kerberos for Postgres?
Previous Message Daniele Varrazzo 2016-12-07 01:55:03 Re: Does psycopg2 support Kerberos for Postgres?