Re: Feature branches merged to master for 2.8 release

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: Feature branches merged to master for 2.8 release
Date: 2018-10-29 12:07:44
Message-ID: CA+mi_8b9rM8+wo=f1Z3wTfH+D0J047mFYm=G5ZXJx8VOdXhoqg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

On Mon, Oct 29, 2018 at 11:47 AM Federico Di Gregorio <fog(at)dndg(dot)it> wrote:

> I agree with
> Daniele here but the fact that the *content* of the capsule, i.e., the
> PGconn* can change depending of the libpq version you're loading is
> pretty scary. I'd like to warn the client code (Python warnings to be
> suppressed? mm..) but just prepending an underscore to the method name
> doesn't mean much. If we add `get_native_connection()` then it becomes
> an official and supported psycopg extensions and doesn't make sense to
> mark it as private API.

The PGconn is an opaque structure: its correct usage is through the
libpq functions. See also the note in
<https://www.postgresql.org/docs/current/static/libpq-status.html>:
"libpq application programmers should be careful to maintain the
PGconn abstraction. Use the accessor functions described below to get
at the contents of PGconn. Reference to internal PGconn fields using
libpq-int.h is not recommended because they are subject to change in
the future." If the structure changes and someone gets bitten by it
it's not really related to how much private the method is.

-- Daniele

In response to

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2018-10-29 12:12:56 Re: Feature branches merged to master for 2.8 release
Previous Message Federico Di Gregorio 2018-10-29 11:48:10 Re: Feature branches merged to master for 2.8 release