pgsql: Make dblink interruptible, via new libpqsrv APIs.

From: Noah Misch <noah(at)leadboat(dot)com>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Make dblink interruptible, via new libpqsrv APIs.
Date: 2025-04-03 16:36:55
Message-ID: E1u0NYl-002ULx-1C@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

The original commit d3c5f37dd543498cc7c678815d3921823beec9e9 did not
back-patch. Back-patch now to v16-v13, bringing coverage to all supported
versions. This back-patch omits the orignal's refactoring in postgres_fdw.

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

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/82a8f0f465ea4bb0d2774f9856ecd62067796686

Modified Files
--------------
contrib/dblink/dblink.c | 24 ++--
.../libpqwalreceiver/libpqwalreceiver.c | 9 +-
src/include/libpq/libpq-be-fe-helpers.h | 127 +++++++++++++++++++++
3 files changed, 143 insertions(+), 17 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2025-04-03 17:30:29 pgsql: Restrict copying of invalidated replication slots.
Previous Message Álvaro Herrera 2025-04-03 15:50:24 pgsql: Remove duplicate set of print_notnull