pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: libpq: Add support for Close on portals and statements
Date: Tue, 04 Jul 2023 05:48:24 +0000
Message-ID: <E1qGYtk-001pM8-6G@gemulon.postgresql.org> (raw)

libpq: Add support for Close on portals and statements

The following routines are added to libpq:
PGresult *PQclosePrepared(PGconn *conn, const char *stmt);
PGresult *PQclosePortal(PGconn *conn, const char *portal);
int PQsendClosePrepared(PGconn *conn, const char *stmt);
int PQsendClosePortal(PGconn *conn, const char *portal);

The "send" routines are non-blocking versions of the two others.

Close messages are part of the protocol but they did not have a libpq
implementation.  And, having these routines is for instance useful with
connection poolers as these can detect more easily Close messages
than DEALLOCATE queries.

The implementation takes advantage of what the Describe routines rely on
for portals and statements.  Some regression tests are added in
libpq_pipeline, for the four new routines, by closing portals and
statements created already by the tests.

Author: Jelte Fennema
Reviewed-by: Jian He, Michael Paquier
Discussion: https://postgr.es/m/CAGECzQTb4xFAopAVokudB+L62Kt44mNAL4Z9zZ7UTrs1TRFvWA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/28b5726561841556dc3e00ffe26b01a8107ee654

Modified Files
--------------
doc/src/sgml/libpq.sgml                            | 125 +++++++++++++++++++--
src/interfaces/libpq/exports.txt                   |   4 +
src/interfaces/libpq/fe-exec.c                     | 124 ++++++++++++++++----
src/interfaces/libpq/fe-protocol3.c                |  19 +++-
src/interfaces/libpq/libpq-fe.h                    |   6 +
src/interfaces/libpq/libpq-int.h                   |   2 +-
src/test/modules/libpq_pipeline/libpq_pipeline.c   |  65 +++++++++++
.../modules/libpq_pipeline/traces/prepared.trace   |  24 ++++
8 files changed, 337 insertions(+), 32 deletions(-)



Message-ID: <E1qGYtk-001pM8-6G@gemulon.postgresql.org>
Permalink:  ../E1qGYtk-001pM8-6G@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qGYtk-001pM8-6G@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: libpq: Add support for Close on portals and statements
  In-Reply-To: <E1qGYtk-001pM8-6G@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox