Re: RFC: Extend psycopg2.connect to accept all valid parameters? - Mailing list psycopg

From Daniele Varrazzo
Subject Re: RFC: Extend psycopg2.connect to accept all valid parameters?
Date
Msg-id CA+mi_8b6qxhyVXtH5t9-g_04Q2H2Ybhpe062q+p7C28Z5fxnMQ@mail.gmail.com
Whole thread Raw
In response to RFC: Extend psycopg2.connect to accept all valid parameters?  (Fabian Knittel <fabian.knittel@avona.com>)
Responses Re: RFC: Extend psycopg2.connect to accept all valid parameters?
List psycopg
Hello Fabian,

On Wed, Nov 16, 2011 at 5:56 PM, Fabian Knittel
<fabian.knittel@avona.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

psycopg by date:

Previous
From: Fabian Knittel
Date:
Subject: RFC: Extend psycopg2.connect to accept all valid parameters?
Next
From: Fabian Knittel
Date:
Subject: Re: RFC: Extend psycopg2.connect to accept all valid parameters?