Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gBvRj-0004Sm-IF for psycopg@arkaria.postgresql.org; Mon, 15 Oct 2018 05:29:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gBvRg-00048T-Rz for psycopg@arkaria.postgresql.org; Mon, 15 Oct 2018 05:29:36 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gBvRg-00048M-JF for psycopg@lists.postgresql.org; Mon, 15 Oct 2018 05:29:36 +0000 Received: from mail-oi1-x235.google.com ([2607:f8b0:4864:20::235]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gBvRW-0007dl-G9 for psycopg@postgresql.org; Mon, 15 Oct 2018 05:29:35 +0000 Received: by mail-oi1-x235.google.com with SMTP id s69-v6so14089612oie.10 for ; Sun, 14 Oct 2018 22:29:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aQui3iOIovwn8kIISQ+bEIw6zcT6bZj4J7yeJw1OmAA=; b=fTdYVfOaBEpbMQ3Oy0iUwoefb6rcHastDYAhjKbAPNI6CZkIpWuj5p+beZ0BOgTL0J VASsTguTiBF2ZD0cOcNkn1vUaXg2Glb65cku+cRqXOMYmhqH2AZcJBpiXPX7K9yR2SWh annn1NKkneqVxuI5FiVrplLwHAem4KJMCmpWcIBXUsqCcjBfU+sK9ou/zVq2jr95/Wxh Khqm92hCI2RkH3/5sDtj1AyHE7hF3yYsPBgBu+yevZB7qpwEvurf0TZjaaKqJrom6L/A N/QZnlEV68AKQocA4yoqAzDukTo3D+Yqxmtth8+GFF8t6Az+TCIjMGnsVf2EV3ojvScq OOGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aQui3iOIovwn8kIISQ+bEIw6zcT6bZj4J7yeJw1OmAA=; b=cmGnrov8P1cDyFcYuSyym7hEckfwPo8ETt3r2xlXq47sCzVrF0g6USBiNi66/n97KW AeFEFWXEmx2dRDH6PTL89lTe2/fhS9aHUWJxQ12TyN6zGJ3TkPKzi5Eww0yKqcmOGqnx 8MbUbOAc3TfhY3PyLBepmrdRRw/VJg1/EJLTd+6lDH4YYPS/w6tOx/CRfJ/dEti984fH OkEjrrMw75ip396VC0adKhlo3goEqtqv724QECTT4FgeHwHo0x+tsAb5F/Csn5FDpKZK 0OO9Pktc/cnk8uG3BVCMByp7ctKxFeoCaAO1WyoYStjvp53EeC70TBqSxftixTLByz+z IDhQ== X-Gm-Message-State: ABuFfogqK+Th7LRCXCvxnxRAHoLcoOH6Bo+HdUCPV4rvdZvZ7+Xce2X9 nKky5W6E/hvHwyJGDudKz/KYhSIxeH3ytohLIIPj2w== X-Google-Smtp-Source: ACcGV635RYiKrMHjYwxCYFNuQ3KQzPbRBizBPlyCpiyW1qWwKrxdzAS83x9b0YkjG9admdKLyR7mkG/9CyQGipv2Q50= X-Received: by 2002:aca:e84d:: with SMTP id f74-v6mr7898383oih.87.1539581363170; Sun, 14 Oct 2018 22:29:23 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Murtuza Zabuawala Date: Mon, 15 Oct 2018 10:59:11 +0530 Message-ID: Subject: Re: Adding an informative object to the connection To: Daniele Varrazzo Cc: psycopg@postgresql.org Content-Type: multipart/alternative; boundary="00000000000041452605783db847" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --00000000000041452605783db847 Content-Type: text/plain; charset="UTF-8" +1 -- Regards, Murtuza Zabuawala EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company On Fri, Oct 12, 2018 at 10:16 PM Daniele Varrazzo < daniele.varrazzo@gmail.com> wrote: > Hi, > > a few days ago we were contributed a merge request for an `.host` > attribute on the connection. But looking back at the bug > (https://github.com/psycopg/psycopg2/issues/726) I had already noticed > there are other interesting informative connection functions in the > libpq. Some of them are already exposed as methods of the connection > class (e.g. get_backend_pid(), get_transaction_status() etc), but I > can see a trickle of requests for others, so I'd rather expose > most/all of them. > > Instead of bloating the connection class with more and more attributes > and methods, I'm rather adding a connection.info method to retrieve > pgconn-specific information. The work is happening in this branch: > > https://github.com/psycopg/psycopg2/commits/connection-info > > I would softly deprecate the currently exposed informative methods: > not sending them away in a short time but giving a preference to use > from the 'info' object what belongs to the pgconn/libpq and to leave > on the connection things regarding the Python layer, and clean up the > interfaces a little bit. > > Any input is welcome. Cheers! > > -- Daniele > > --00000000000041452605783db847 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
+1

--
Regards,
Murtuza Zabuawala
= EnterpriseDB:=C2=A0http://www.enterprisedb.com
The Enterprise Pos= tgreSQL Company


<= br>
On Fri, Oct 12, 2018 at 10:1= 6 PM Daniele Varrazzo <dan= iele.varrazzo@gmail.com> wrote:
Hi,

a few days ago we were contributed a merge request for an `.host`
attribute on the connection. But looking back at the bug
(https://github.com/psycopg/psycopg2/issues/726) I= had already noticed
there are other interesting informative connection functions in the
libpq. Some of them are already exposed as methods of the connection
class (e.g. get_backend_pid(), get_transaction_status() etc), but I
can see a trickle of requests for others, so I'd rather expose
most/all of them.

Instead of bloating the connection class with more and more attributes
and methods, I'm rather adding a connection.info method to retrieve pgconn-specific information. The work is happening in this branch:

https://github.com/psycopg/psycopg2/commi= ts/connection-info

I would softly deprecate the currently exposed informative methods:
not sending them away in a short time but giving a preference to use
from the 'info' object what belongs to the pgconn/libpq and to leav= e
on the connection things regarding the Python layer, and clean up the
interfaces a little bit.

Any input is welcome. Cheers!

-- Daniele

--00000000000041452605783db847--