Re: Does psycopg2 support Kerberos for Postgres?

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

Sorry Adrian for the confusion. I was actually referring the builds below which have no libpq dependency.

https://repo.continuum.io/pkgs/free/linux-64/psycopg2-2.6-py34_1.tar.bz2
https://repo.continuum.io/pkgs/free/linux-64/psycopg2-2.6.1-py27_0.tar.bz2

Do you know why the libpq is added as dependency?

Thanks.

Yang

-----Original Message-----
From: Adrian Klaver [mailto:adrian(dot)klaver(at)aklaver(dot)com]
Sent: Thursday, December 08, 2016 4:04 PM
To: Yang Gao; 'Daniele Varrazzo'
Cc: psycopg(at)postgresql(dot)org
Subject: Re: [psycopg] Does psycopg2 support Kerberos for Postgres?

On 12/08/2016 11:01 AM, Yang Gao wrote:
> 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?

You sure about that?:

{
"build": "py35_0",
"build_number": 0,
"channel": "defaults",
"date": "2016-08-25",
"depends": [
"libpq",
"openssl",
"python 3.5*"
],
"extracted": true,
"features": [],
"fn": "psycopg2-2.6.2-py35_0.tar.bz2",
"full_channel": "https://repo.continuum.io/pkgs/free/linux-64",
"installed": false,
"license": "LGPL, BSD-like, ZPL",
"license_family": "LGPL",
"md5": "5ee356151c0049ae30f3c0afd723775b",
"name": "psycopg2",
"priority": 0,
"requires": [],
"schannel": "defaults",
"size": 417719,
"type": null,
"url":
"https://repo.continuum.io/pkgs/free/linux-64/psycopg2-2.6.2-py35_0.tar.bz2",
"version": "2.6.2"
}

It sees the dependency git added in the change from psycopg2 2.6.1 --> 2.6.1, not based on Python version:

{
"build": "py27_1",
"build_number": 1,
"channel": "defaults",
"date": "2016-02-22",
"depends": [
"openssl 1.0.2*",
"python 2.7*"
],
"extracted": false,
"features": [],
"fn": "psycopg2-2.6.1-py27_1.tar.bz2",
"full_channel": "https://repo.continuum.io/pkgs/free/linux-64",
"installed": false,
"license": "LGPL, BSD-like, ZPL",
"license_family": "LGPL",
"md5": "cfc47131fc25f954e852658ed902f945",
"name": "psycopg2",
"priority": 0,
"requires": [],
"schannel": "defaults",
"size": 442528,
"type": null,
"url":
"https://repo.continuum.io/pkgs/free/linux-64/psycopg2-2.6.1-py27_1.tar.bz2",
"version": "2.6.1"
},

{
"build": "py35_0",
"build_number": 0,
"channel": "defaults",
"date": "2015-09-29",
"depends": [
"openssl 1.0.1*",
"python 3.5*"
],
"extracted": false,
"features": [],
"fn": "psycopg2-2.6.1-py35_0.tar.bz2",
"full_channel": "https://repo.continuum.io/pkgs/free/linux-64",
"installed": false,
"license": "LGPL, BSD-like, ZPL",
"license_family": "LGPL",
"md5": "c81233e8c3ded76a6f25c9567d2a2c91",
"name": "psycopg2",
"priority": 0,
"requires": [],
"schannel": "defaults",
"size": 467021,
"type": null,
"url":
"https://repo.continuum.io/pkgs/free/linux-64/psycopg2-2.6.1-py35_0.tar.bz2",
"version": "2.6.1"
},

>
> 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
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Adrian Klaver 2016-12-09 15:16:09 Re: Does psycopg2 support Kerberos for Postgres?
Previous Message Adrian Klaver 2016-12-08 21:04:17 Re: Does psycopg2 support Kerberos for Postgres?