Re: [19] CREATE SUBSCRIPTION ... SERVER - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: [19] CREATE SUBSCRIPTION ... SERVER
Date
Msg-id CAD21AoCpr8UfmOngKZ92hZ-78cr2H+3Tbs9QLveYoWnWBfxrxw@mail.gmail.com
Whole thread Raw
In response to Re: [19] CREATE SUBSCRIPTION ... SERVER  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: [19] CREATE SUBSCRIPTION ... SERVER
List pgsql-hackers
On Mon, Mar 2, 2026 at 1:34 PM Jeff Davis <pgsql@j-davis.com> wrote:
>
> On Thu, 2026-02-26 at 11:12 -0800, Jeff Davis wrote:
> > On Wed, 2026-02-04 at 13:53 +0900, Masahiko Sawada wrote:
> > > I've reviewed the latest patch set. I understand the motivation
> > > behind
> > > this proposal and find it useful.
> >
> > Thank you, that's important feedback.
>
> Attached v18:
>
>   * rebase
>   * Changed ForeignServerConnectionString() to use a local variable
> rather than a static. It's not very performance-sensitive, so it's OK
> to create a memory context for each invocation, which will be deleted.
> I'm not aware of an actual problem in the previous code, but it seemed
> a bit less safe.
>
> I plan to commit the main patch (v18-0001) soon, after rechecking some
> details (like the postgres_fdw upgrade).

I have a few minor comments:

+   Oid         subserver;      /* Set if connecting with server */
+

Do we want to add BKI_LOOKUP(pg_foreign_data_wrapper) here?

---
+
+# Copyright (c) 2021-2024, PostgreSQL Global Development Group
+

Need to update the copyright year.

The rest looks good to me.

> v18-0002 could use some review
> first.

Thank you for making this patch. I'll look at this patch too.

FYI interestingly, dblink_fdw can also be used for subscription
connections like postgres_fdw. It made me think that it might be
interesting to implement a FDW that supports only the libpq connection
(i.e., NO HANDLER, NO VALIDATOR, and CONNECTION) as it provides the
connection management capability useful for subscriptions while users
can avoid any security risks in postgres_fdw that users might be
concerned about.

Regards,

--
Masahiko Sawada
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Florin Irion
Date:
Subject: Re: [PATCH] pg_get_domain_ddl: DDL reconstruction function for CREATE DOMAIN statement
Next
From: Lukas Fittl
Date:
Subject: Re: Reduce timing overhead of EXPLAIN ANALYZE using rdtsc?