Re: Different table schema in logical replication crashes

From: Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com>
To: Euler Taveira <euler(at)timbira(dot)com(dot)br>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Re: Different table schema in logical replication crashes
Date: 2017-04-14 12:49:01
Message-ID: 068a0187-9f49-63f2-e972-a6c13f2ea4d8@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 13/04/17 05:04, Euler Taveira wrote:
> Hi,
>
> If a certain table has different schemas and the subscriber table has an
> unmatched column with a not null constraint, the logical replication
> crashes with the above stack trace.
>
> [snip]
>
> Are we prepared to support different schemas in v10? Or should we
> disallow it for v10 and add a TODO?
>

Ah nuts, yes it's supposed to be supported, we seem to not initialize
cstate->range_table in tablesync which causes this bug. The CopyState
struct is private to copy.c so we can't easily set cstate->range_table
externally. I wonder if tablesync should just construct CopyStmt instead
of calling the lower level API.

--
Petr Jelinek http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-04-14 12:57:32 Re: Tuplesort merge pre-reading
Previous Message Petr Jelinek 2017-04-14 12:44:34 Re: Logical replication and inheritance