public inbox for [email protected]
help / color / mirror / Atom feedFrom: Masahiko Sawada <[email protected]>
To: Jeff Davis <[email protected]>
Cc: Shlok Kyal <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: Bharath Rupireddy <[email protected]>
Cc: Joe Conway <[email protected]>
Cc: [email protected]
Subject: Re: [19] CREATE SUBSCRIPTION ... SERVER
Date: Wed, 4 Feb 2026 13:53:20 +0900
Message-ID: <CAD21AoA3dOqh4DeRtLJjzBxYaMfmzxw+s9tMo_wgnV7RdfUvtA@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
<CAExHW5vv-78ixJs3arsuZ+12A4AyqehJnDPhejp0m4FAKG6JZA@mail.gmail.com>
<[email protected]>
<CAExHW5sAo4Gv3AwuxQNGSQ2Z45B8_MZEb-SG-B8D-hLMdrquAg@mail.gmail.com>
<[email protected]>
<[email protected]>
<CAExHW5unvpDv6yMSmqurHP7Du1PqoJFWVxeK-4YNm5EnoNJiSQ@mail.gmail.com>
<[email protected]>
<CAExHW5sQVJeCgCGMkum_k4Z4VPaK5GkdAjHW-d+F3MngBZ9qBA@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<CALj2ACXDua2Az15Kj3OZFaRm49G8-faemiEEv8t9GNCcsxv8Hw@mail.gmail.com>
<[email protected]>
<CAExHW5v5poohyfNRVQp3yjVE56ej0dWvVMbysSSVtg21aHT3uQ@mail.gmail.com>
<[email protected]>
<CAExHW5vF+cp9efQj=-W+Rhbr9f9ZZqt3XFnP0NB5jKsm=C=5tw@mail.gmail.com>
<[email protected]>
<[email protected]>
<CAExHW5uCzS-VeSYQHTHxFSdQik-f_O892xmzrzm2fuO+ro+otA@mail.gmail.com>
<[email protected]>
<CAExHW5vDPBB_PShBmSj=v=Jf1K=vSmWdPZTzCJsLpqDgqek+sA@mail.gmail.com>
<[email protected]>
<CAExHW5uirmv8tj7LJ3zDo2tfaP_fffAeRbKT--3vBe7pa0in0g@mail.gmail.com>
<[email protected]>
<CAExHW5v5yn7HSD86OJ+Fj-FUcZK4mT40i7DBZoU2hQwfpeYLvw@mail.gmail.com>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<CANhcyEUoJeXw2W8TtUZRK48YLuV7R_cKsu=KfvgCAh0YqCC4gw@mail.gmail.com>
<[email protected]>
<[email protected]>
On Sat, Jan 10, 2026 at 8:55 PM Jeff Davis <[email protected]> wrote:
>
> On Fri, 2025-12-26 at 13:52 -0800, Jeff Davis wrote:
> > On Wed, 2025-04-02 at 17:58 +0530, Shlok Kyal wrote:
> > > I reviewed the patch and I have a comment:
> > >
> > > If version is >=18, the query will have 'suboriginremotelsn',
> > > 'subenabled', 'subfailover' twice.
> >
> > Thank you. Fixed and rebased.
>
> Attached new version with significant changes:
>
> - fixed several issues (including some improper merges in the last
> rebase)
> - refactored to share code between postgres_fdw_connection() and
> connect_pg_server()
> - added docs in postgres_fdw
> - added tests in core
> - bumped postgres_fdw version to 1.3
>
I've reviewed the latest patch set. I understand the motivation behind
this proposal and find it useful. Here are some comments:
@@ -5580,6 +5580,8 @@ fdw_option:
| NO HANDLER { $$ =
makeDefElem("handler", NULL, @1); }
| VALIDATOR handler_name { $$ =
makeDefElem("validator", (Node *) $2, @1); }
| NO VALIDATOR { $$ =
makeDefElem("validator", NULL, @1); }
+ | CONNECTION handler_name { $$ =
makeDefElem("connection", (Node *) $2, @1); }
+ | NO CONNECTION { $$ =
makeDefElem("connection", NULL, @1); }
;
The documentation for ALTER FOREIGN DATA WRAPPER needs to be updated.
---
The security section[1] of logical replication chapter would also need
to be updated. Currently we have:
To create a subscription, the user must have the privileges of the
pg_create_subscription role, as well as CREATE privileges on the
database.
IIUC if the user uses the SERVER clause, they must have the USAGE
privilege on the foreign server too.
---
We might want to mention in the documentation of CREATE SERVER[2] that
a foreign server's name can be used to connect publication in CREATE
SUBSCRIPTION as we have a similar description for dblink_connect():
When using the dblink module, a foreign server's name can be used as
an argument of the dblink_connect function to indicate the connection
parameters. It is necessary to have the USAGE privilege on the foreign
server to be able to use it in this way.
---
dblink_connect() function can retrieve the connection string from a
foreign server specified in the second argument, which is a very
similar use case to CREATE SUBSCRIPTION. Should we make dblink use the
new function ForeignServerConnectionString() to get the connection
string (in get_connect_string())?
---
It would be better to enhance psql's \dRs command to show the server
name specified in the subscription.
Regards,
[1] https://www.postgresql.org/docs/devel/logical-replication-security.html
[2] https://www.postgresql.org/docs/devel/sql-createserver.html
--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com
view thread (17+ messages) latest in thread
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: [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
Subject: Re: [19] CREATE SUBSCRIPTION ... SERVER
In-Reply-To: <CAD21AoA3dOqh4DeRtLJjzBxYaMfmzxw+s9tMo_wgnV7RdfUvtA@mail.gmail.com>
* 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