Re: adding partitioned tables to publications

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: adding partitioned tables to publications
Дата
Msg-id 04d78603-edae-9243-9dde-fe3037176a7d@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: adding partitioned tables to publications  (Amit Langote <amitlangote09@gmail.com>)
Ответы Re: adding partitioned tables to publications
Список pgsql-hackers
On 2020-04-09 05:39, Amit Langote wrote:
> sub_viaroot ERROR:  number of columns (2601) exceeds limit (1664)
> sub_viaroot CONTEXT:  slot "sub_viaroot", output plugin "pgoutput", in
> the change callback, associated LSN 0/1621010

I think the problem is that in maybe_send_schema(), 
RelationClose(ancestor) releases the relcache entry, but the tuple 
descriptors, which are part of the relcache entry, are still pointed to 
by the tuple map.

This patch makes the tests pass for me:

diff --git a/src/backend/replication/pgoutput/pgoutput.c 
b/src/backend/replication/pgoutput/pgoutput.c
index 5fbf2d4367..cf6e8629c1 100644
--- a/src/backend/replication/pgoutput/pgoutput.c
+++ b/src/backend/replication/pgoutput/pgoutput.c
@@ -305,7 +305,7 @@ 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);

Please check.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: [HACKERS] make async slave to wait for lsn to be replayed
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Vacuum o/p with (full 1, parallel 0) option throwing an error