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 1g9X9Y-0005j9-GN for psycopg@arkaria.postgresql.org; Mon, 08 Oct 2018 15:09:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g9X9W-0002jg-PN for psycopg@arkaria.postgresql.org; Mon, 08 Oct 2018 15:08:58 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g9X9W-0002jY-H9 for psycopg@lists.postgresql.org; Mon, 08 Oct 2018 15:08:58 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g9X9S-0000z6-Pg for psycopg@lists.postgresql.org; Mon, 08 Oct 2018 15:08:57 +0000 Received: by mail-lf1-x12b.google.com with SMTP id q39-v6so14170736lfi.8 for ; Mon, 08 Oct 2018 08:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2Rcz1YZ1rH3bjnV71tVU/zOF+kqjl9QcNygu7vomHvM=; b=MdvWodaSudcnGYAJhmGY9PCwaSRv/GNsFrJaFjXj/bUHSRYmoittB1ItZUUNLc8ODP IW89X7v1sSdxH//OwbVP9v+BGzMXwEbLG5WDjHGDnmj/YJhazy+TOqoLtwLbgHH6Y4VL eSHgk23PaUZQVCsPJTqHB2LaVVhI0eRekYFt1YbfN4JVgcabmzXE55mMBhSEbyrpDzYg xcx44s0Ixb+l/HE/D60qqTQeNbEz2rR0TH4Uv8qjPT8YSN18ez65aDyz6p+gwi3mRoNG uiBgAhemOlYYum2ZBNB1cMiTVeqH0GLguO1pQxLHKPRLE/q6/TBNswhzZSdYERLNS19c C4pw== 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=2Rcz1YZ1rH3bjnV71tVU/zOF+kqjl9QcNygu7vomHvM=; b=SusykjfLfTDl+Eov8vHEjEaCc1BfSJ1aKAFZw46HlUv6JJ48wqm3jtbHpFZayB6thc uuuaDUmSuBKohNyWftSst2NKARz8ElbgKaJmZk8YiGJyWfTvxr2FPGAGFQRKp69L3XAJ MBv1ojmhe+kpPRjyDwTQYWLjRCgL0WkIk+wStY/H2ePDnmtJ+OmeD5ixw2vtTJKC/3Cu 3kLSP4vcw0DZdeal+Pq5DjPYQvQK8FC4VCcUhb6d+F+DRPVWxxkOcvE3OZPVnCehdkmf rQ8VY0kQIjiI1ryIJNchvU7e+qwWHtu0QJ/XqZI2O3ksRGm612sDEKMzf6PI04Enx+19 tczQ== X-Gm-Message-State: ABuFfojXBWohzcTZvr1ug+QIG+ZlcyuSKe7USOVkLgR2PNYYhrezU1n6 wZmeS6mmmdxiXQsvuzRad62Xl03yPxytfef2AUZAapqt X-Google-Smtp-Source: ACcGV62aagiafTepD20+Dno+rmyjMKJMYvSn7ihqbPO0GSh2PpM3F3e73h6UgfRIlvm1JsuXA4v8A5wcxB86liSTq2k= X-Received: by 2002:a19:5a8f:: with SMTP id y15-v6mr12491010lfk.15.1539011332866; Mon, 08 Oct 2018 08:08:52 -0700 (PDT) MIME-Version: 1.0 References: <1005537726.6324310.1538685211791@mail.yahoo.com> <602182297.6960405.1538755378178@mail.yahoo.com> <618fbba4-0f31-2e44-8517-a158cccbef0d@dndg.it> In-Reply-To: <618fbba4-0f31-2e44-8517-a158cccbef0d@dndg.it> From: Daniele Varrazzo Date: Mon, 8 Oct 2018 16:08:41 +0100 Message-ID: Subject: Re: Integration of Psycopg with XTA To: Federico Di Gregorio Cc: psycopg@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sun, Oct 7, 2018 at 12:56 PM Federico Di Gregorio 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