Re: Segfault on logical replication to partitioned table with foreign children - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Segfault on logical replication to partitioned table with foreign children
Date
Msg-id 20221030155239.55zehfskzdppokox@alvherre.pgsql
Whole thread Raw
In response to Segfault on logical replication to partitioned table with foreign children  (ilya.v.gladyshev@gmail.com)
Responses Re: Segfault on logical replication to partitioned table with foreign children  (Ilya Gladyshev <ilya.v.gladyshev@gmail.com>)
List pgsql-hackers
On 2022-Oct-28, ilya.v.gladyshev@gmail.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)



pgsql-hackers by date:

Previous
From: 1DS20CS093 Joseph Raj Vishal
Date:
Subject: Re: How to started with Contributions
Next
From: Justin Pryzby
Date:
Subject: pg15 inherited stats expressions: cache lookup failed for statistics object