agora inbox for pgsql-committers@postgresql.org  
help / color / mirror / Atom feed
From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Always check foreign-server USAGE when resolving subscription co
Date: Wed, 05 Aug 2026 20:26:31 +0000
Message-ID: <E1wriC7-00000000LHG-05rb@gemulon.postgresql.org> (raw)

Always check foreign-server USAGE when resolving subscription conninfo.

Previously, this was skipped in some cases to avoid raising errors
when conninfo wasn't even needed. That was wrong in cases where
conninfo was needed.

Now that we only build conninfo when needed, always perform the USAGE
check.

Addresses finding 7 in report from linked discussion.

Co-authored-by: Shlok Kyal <shlok.kyal.oss@gmail.com>
Reported-by: Noah Misch <noah@leadboat.com>
Reviewed-by: Shlok Kyal <shlok.kyal.oss@gmail.com>
Reviewed-by: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
Reviewed-by: Amit Kapila <amit.kapila16@gmail.com>
Discussion: https://postgr.es/m/20260710195902.4f.noahmisch%40microsoft.com
Backpatch-through: 19

Branch
------
REL_19_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5ba18183c4ca34beeedf7023d1f260ba1f5e9f87

Modified Files
--------------
src/backend/catalog/pg_subscription.c      | 23 ++++++++++-------------
src/backend/commands/subscriptioncmds.c    |  9 +--------
src/backend/replication/logical/worker.c   |  4 ++--
src/include/catalog/pg_subscription.h      |  2 +-
src/test/regress/expected/subscription.out |  3 +++
src/test/regress/sql/subscription.sql      |  3 +++
6 files changed, 20 insertions(+), 24 deletions(-)



view thread (2+ messages)

Message-ID: <E1wriC7-00000000LHG-05rb@gemulon.postgresql.org>
Permalink:  ../E1wriC7-00000000LHG-05rb@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1wriC7-00000000LHG-05rb@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: jdavis@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Always check foreign-server USAGE when resolving subscription co
  In-Reply-To: <E1wriC7-00000000LHG-05rb@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 agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox