Re: [psycopg] Does psycopg2 support Kerberos for Postgres? - Mailing list psycopg
From | Yang Gao |
---|---|
Subject | Re: [psycopg] Does psycopg2 support Kerberos for Postgres? |
Date | |
Msg-id | 64d582f976e94202889e0696738e4cde@exmbdft5.ad.twosigma.com Whole thread Raw |
In response to | Re: Does psycopg2 support Kerberos for Postgres? (Adrian Klaver <adrian.klaver@aklaver.com>) |
Responses |
Re: [psycopg] Does psycopg2 support Kerberos for Postgres?
|
List | 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.klaver@aklaver.com] Sent: Thursday, December 08, 2016 4:04 PM To: Yang Gao; 'Daniele Varrazzo' Cc: psycopg@postgresql.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 containsa 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 forpython3 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 theshared 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 dependencydeclared 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.varrazzo@gmail.com] > Sent: Tuesday, December 06, 2016 8:55 PM > To: Yang Gao > Cc: Adrian Klaver; psycopg@postgresql.org > Subject: Re: [psycopg] Does psycopg2 support Kerberos for Postgres? > > On Tue, Dec 6, 2016 at 6:09 PM, Yang Gao <Yang.Gao@twosigma.com> wrote: >> Got it, so psycopq uses the Postgres c-lib directly. Then, what is the recommended way of managing libpq? Looks like whenI installed psycopq from PyPi, it also pulled down this dependency which has no Kerberos support. Is there better wayto 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 givethe 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 aboutkerberos 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 seemsConda ships a libpq build without kerberos support: you may want to open a bug with them and ask for a more completebuild. 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.klaver@aklaver.com