GetSubscription(): use per-object memory context.
Jeff Davis <jdavis@postgresql.org>
GetSubscription(): use per-object memory context. Constructing a Subcription object uses a number of small or temporary allocations. Use a per-object memory context for easy cleanup. Get rid of FreeSubscription() which did not free all the allocations anyway. Also get rid of the PG_TRY()/PG_CATCH() logic in ForeignServerConnectionString() which were used to avoid leaks during GetSubscription(). Co-authored-by: Álvaro Herrera <alvherre@kurilemu.de> Suggested-by: Andres Freund <andres@anarazel.de> Reviewed-by: Amit Kapila <amit.kapila16@gmail.com> Discussion: https://postgr.es/m/xvdjrdqnpap3uq7owbaox3r7p5gf7sv62aaqf2ju3vb6yglatr%40kvvwhoudrlxq Discussion: https://postgr.es/m/CAA4eK1K=WjZ1maBCmj=5ZdO66AwPORK5ZBxVKedS0xdCcb621A@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/pg_subscription.c | modified | +10 −14 |
| src/backend/foreign/foreign.c | modified | +18 −48 |
| src/backend/replication/logical/worker.c | modified | +18 −18 |
| src/include/catalog/pg_subscription.h | modified | +2 −1 |
Discussion
- [17] CREATE SUBSCRIPTION ... SERVER 78 messages · 2023-08-30 → 2026-04-10
Cited messages not in the archive:
xvdjrdqnpap3uq7owbaox3r7p5gf7sv62aaqf2ju3vb6yglatr@kvvwhoudrlxq