Re: Segfault on logical replication to partitioned table with foreign children

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: ilya(dot)v(dot)gladyshev(at)gmail(dot)com
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Segfault on logical replication to partitioned table with foreign children
Date: 2022-10-30 15:52:39
Message-ID: 20221030155239.55zehfskzdppokox@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2022-Oct-28, ilya(dot)v(dot)gladyshev(at)gmail(dot)com wrote:

> This will cause a segfault or raise an assert, because inserting into
> foreign tables via logical replication is not possible. The solution I
> propose is to add recursive checks of relkind for children of a target,
> if the target is a partitioned table.

However, I imagine that the only reason we don't support this is that
the code hasn't been written yet. I think it would be better to write
that code, so that we don't have to raise any error at all (unless the
foreign table is something that doesn't support DML, in which case we
would have to raise an error). Of course, we still have to fix it in
backbranches, but we can just do it as a targeted check at the moment of
insert/update, not at the moment of subscription create/alter.

--
Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/
"The eagle never lost so much time, as
when he submitted to learn of the crow." (William Blake)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2022-10-30 17:05:20 pg15 inherited stats expressions: cache lookup failed for statistics object
Previous Message 1DS20CS093 Joseph Raj Vishal 2022-10-30 14:45:25 Re: How to started with Contributions