Re: [19] CREATE SUBSCRIPTION ... SERVER
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>,
Masahiko Sawada <sawada.mshk@gmail.com>, Shlok Kyal <shlok.kyal.oss@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>,
Joe Conway <mail@joeconway.com>, pgsql-hackers@postgresql.org
Date: 2026-03-17T05:59:40Z
Lists: pgsql-hackers
On Mon, Mar 16, 2026 at 9:56 PM Jeff Davis <pgsql@j-davis.com> wrote: > > On Mon, 2026-03-16 at 11:08 +0530, Amit Kapila wrote: > > Won't it be sufficient if we just reset MySubscriptionCtx here or in > > callback subscription_change_cb()? > > The old and new subscriptions are compared against eachother (to see > whether to restart the worker or not), so they both have to exist at > the same time. If we put them in the same context, then we can't reset > it. > > I suppose we could have just two contexts and switch back and forth > between them, resetting the last one. But that doesn't seem to be worth > the trouble. > Yeah, or the other possibility could be to let the newsub information get allocated in the current transaction context and reset the subscription context if we decide not to exit from the worker. Then copy/get the subscription info in subscription context but not sure if that is worth it. The minor oddity in the proposed approach is that the worker will exit in many cases after allocating the new context but that may be the best we can do here. -- With Regards, Amit Kapila.
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Document new catalog columns, missed in commit 8185bb5347.
- 90630ec42939 19 (unreleased) landed
-
Refactor to remove ForeignServerName().
- 11f8018ee678 19 (unreleased) landed
-
GetSubscription(): use per-object memory context.
- f16f5d608ca6 19 (unreleased) landed
-
Fix dependency on FDW's connection function.
- 4a0b46b6e1e4 19 (unreleased) landed
-
ALTER SUBSCRIPTION ... SERVER test.
- 1c5bf1185af0 19 (unreleased) landed
-
Fix pg_dump for CREATE FOREIGN DATA WRAPPER ... CONNECTION.
- b71bf3b84570 19 (unreleased) landed
-
Clean up postgres_fdw/t/010_subscription.pl.
- f4af7849b3db 19 (unreleased) landed
-
CREATE SUBSCRIPTION ... SERVER.
- 8185bb534763 19 (unreleased) landed
-
Allow upgrades to preserve the full subscription's state.
- 9a17be1e244a 17.0 cited