summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2020-04-11 13:07:25 +0000
committerPeter Eisentraut2020-04-11 13:07:25 +0000
commit12fb189bfeaf03faea5b6f15544c1f71e9ef4677 (patch)
treeac9acdd3a812cb263a52a7bfc44100eed98439be
parent5a1d0c9925fbda9ec434061dee74b1b5d9a16038 (diff)
Fix RELCACHE_FORCE_RELEASE issue
Introduced by 83fd4532a72179c370e318075a10e0e2aa832024. To fix, the tuple descriptors need to be copied into the current memory context. Discussion: https://www.postgresql.org/message-id/[email protected]
-rw-r--r--src/backend/replication/pgoutput/pgoutput.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/backend/replication/pgoutput/pgoutput.c b/src/backend/replication/pgoutput/pgoutput.c
index 5fbf2d4367b..77b85fc6557 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -305,7 +305,8 @@ maybe_send_schema(LogicalDecodingContext *ctx,
/* Map must live as long as the session does. */
oldctx = MemoryContextSwitchTo(CacheMemoryContext);
- relentry->map = convert_tuples_by_name(indesc, outdesc);
+ relentry->map = convert_tuples_by_name(CreateTupleDescCopy(indesc),
+ CreateTupleDescCopy(outdesc));
MemoryContextSwitchTo(oldctx);
send_relation_and_attrs(ancestor, ctx);
RelationClose(ancestor);