pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Make dblink interruptible, via new libpqsrv APIs.
Date: Mon, 08 Jan 2024 19:41:28 +0000
Message-ID: <E1rMvV2-000VtV-DF@gemulon.postgresql.org> (raw)

Make dblink interruptible, via new libpqsrv APIs.

This replaces dblink's blocking libpq calls, allowing cancellation and
allowing DROP DATABASE (of a database not involved in the query).  Apart
from explicit dblink_cancel_query() calls, dblink still doesn't cancel
the remote side.  The replacement for the blocking calls consists of
new, general-purpose query execution wrappers in the libpqsrv facility.
Out-of-tree extensions should adopt these.  Use them in postgres_fdw,
replacing a local implementation from which the libpqsrv implementation
derives.  This is a bug fix for dblink.  Code inspection identified the
bug at least thirteen years ago, but user complaints have not appeared.
Hence, no back-patch for now.

Discussion: https://postgr.es/m/20231122012945.74@rfd.leadboat.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d3c5f37dd543498cc7c678815d3921823beec9e9

Modified Files
--------------
contrib/dblink/dblink.c                            |  28 +++--
contrib/postgres_fdw/connection.c                  |  88 +++-----------
contrib/postgres_fdw/deparse.c                     |   2 +-
contrib/postgres_fdw/postgres_fdw.c                |  10 +-
contrib/postgres_fdw/postgres_fdw.h                |   2 +-
doc/src/sgml/dblink.sgml                           |   9 ++
.../libpqwalreceiver/libpqwalreceiver.c            |   9 +-
src/include/libpq/libpq-be-fe-helpers.h            | 127 +++++++++++++++++++++
8 files changed, 180 insertions(+), 95 deletions(-)



view thread (5+ messages)  latest in thread

Message-ID: <E1rMvV2-000VtV-DF@gemulon.postgresql.org>
Permalink:  ../E1rMvV2-000VtV-DF@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1rMvV2-000VtV-DF@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: noah@leadboat.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Make dblink interruptible, via new libpqsrv APIs.
  In-Reply-To: <E1rMvV2-000VtV-DF@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