pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@alvh.no-ip.org>
To: ilya.v.gladyshev@gmail.com
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Segfault on logical replication to partitioned table with foreign children
Date: Sun, 30 Oct 2022 16:52:39 +0100
Message-ID: <20221030155239.55zehfskzdppokox@alvherre.pgsql> (raw)
In-Reply-To: <6b93e3748ba43298694f376ca8797279d7945e29.camel@gmail.com>

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)





view thread (12+ messages)  latest in thread

Message-ID: <20221030155239.55zehfskzdppokox@alvherre.pgsql>
Permalink:  ../20221030155239.55zehfskzdppokox@alvherre.pgsql/
Also on:    postgresql.org/message-id/20221030155239.55zehfskzdppokox@alvherre.pgsql

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: alvherre@alvh.no-ip.org, ilya.v.gladyshev@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Segfault on logical replication to partitioned table with foreign children
  In-Reply-To: <20221030155239.55zehfskzdppokox@alvherre.pgsql>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox