Re: RFC: Extend psycopg2.connect to accept all valid parameters?

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Fabian Knittel <fabian(dot)knittel(at)avona(dot)com>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: RFC: Extend psycopg2.connect to accept all valid parameters?
Date: 2011-11-16 18:56:26
Message-ID: CA+mi_8b6qxhyVXtH5t9-g_04Q2H2Ybhpe062q+p7C28Z5fxnMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

Hello Fabian,

On Wed, Nov 16, 2011 at 5:56 PM, Fabian Knittel
<fabian(dot)knittel(at)avona(dot)com> wrote:

> I'm trying to pass the "sslrootcert" connection keyword parameter
> through sqlalchemy and psycopg2.  Unfortunately, that's currently not
> possible in a straightforward way, meaning, this sqlalchemy URI doesn't
> work:
>
>
> postgresql://<username>@<hostname>:<port>/<dbname>?sslmode=verify-full&sslrootcert=<cert>

os.environ['PGSSLROOTCERT'] is (should be) your friend. Also see
<http://www.postgresql.org/docs/9.1/static/libpq-envars.html>.

> Properly fixing it in psycopg2 would probably mean accepting all missing
> keywords [4] in psycopg2.connect.

> 4: Currently missing keywords: hostaddr, connect_timeout,
> client_encoding, options, application_name, fallback_application_name,
> keepalives, keepalives_idle, keepalives_interval, keepalives_count,
> sslcert, sslkey, sslrootcert, sslcrl, requirepeer, krbsrvname, gsslib,
> service. (I've omitted requiressl and tty, because they are
> deprecated/ignored.)

As you see they are a lot, and counting. If I'm not mistaken there is
a fallback env variable for each of them. I've used application_name
sometimes.

-- Daniele

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Fabian Knittel 2011-11-16 19:39:56 Re: RFC: Extend psycopg2.connect to accept all valid parameters?
Previous Message Fabian Knittel 2011-11-16 17:56:46 RFC: Extend psycopg2.connect to accept all valid parameters?