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-16T05:38:49Z
Lists: pgsql-hackers
On Sun, Mar 15, 2026 at 4:25 AM Jeff Davis <pgsql@j-davis.com> wrote:
>
> Attached series including patches to address Andres's and Amit's
> comments, too.
>

0001 LGTM.

0003:
@@ -5056,8 +5058,15 @@ maybe_reread_subscription(void)
  started_tx = true;
  }

- /* Ensure allocations in permanent context. */
- oldctx = MemoryContextSwitchTo(ApplyContext);
+ newctx = AllocSetContextCreate(ApplyContext,
+    "Subscription Context",
+    ALLOCSET_SMALL_SIZES);
+

Won't it be sufficient if we just reset MySubscriptionCtx here or in
callback subscription_change_cb()?

-- 
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 →
  1. Document new catalog columns, missed in commit 8185bb5347.

  2. Refactor to remove ForeignServerName().

  3. GetSubscription(): use per-object memory context.

  4. Fix dependency on FDW's connection function.

  5. ALTER SUBSCRIPTION ... SERVER test.

  6. Fix pg_dump for CREATE FOREIGN DATA WRAPPER ... CONNECTION.

  7. Clean up postgres_fdw/t/010_subscription.pl.

  8. CREATE SUBSCRIPTION ... SERVER.

  9. Allow upgrades to preserve the full subscription's state.