Re: Integration of Psycopg with XTA

From: Daniele Varrazzo <daniele(dot)varrazzo(at)gmail(dot)com>
To: Federico Di Gregorio <fog(at)dndg(dot)it>
Cc: psycopg(at)lists(dot)postgresql(dot)org
Subject: Re: Integration of Psycopg with XTA
Date: 2018-10-08 15:08:41
Message-ID: CA+mi_8ZcT93E9HAXPtiMQu2SNwQHeor069MAast_-pHdycM+Tw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Sun, Oct 7, 2018 at 12:56 PM Federico Di Gregorio <fog(at)dndg(dot)it> wrote:

> After some more checking I discovered that it isn't possible to
> "invalidate" a PyCapsule so there is no way to tell if the pointer
> inside it is still a valid libpq connection.
>
> The current code (feel free to pull) adds a new method
>
> get_native_connection()
>
> that raise an exception if called on a closed connection. I better like
> a method here because it gives the idea that you need to call it every
> time you want a Capsule to pass to the target C API.
>
> I also added some docs and a dumb test.
>
> https://github.com/fogzot/psycopg2/tree/feature-expose-pgconn
>
> @Daniele, if Christian reports no problems I'll merge this later for 2.8.

LGTM. Do we also want a cursor.get_native_result() to return its PGresult?

-- Daniele

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Christian Ferrari 2018-10-08 19:51:25 Re: Integration of Psycopg with XTA
Previous Message Akshay Joshi 2018-10-08 06:49:14 Re: psycopg2 conn.poll() hangs when used with sshtunnel