pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alvaro Herrera <alvherre@2ndquadrant.com>
To: Rozboril, Robert <robert.rozboril@dxc.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re: PostgreSQL v11.3 - Records are deleted from child table if partition key of parent table is changed
Date: Fri, 21 Jun 2019 09:28:23 -0400
Message-ID: <20190621132823.GA8023@alvherre.pgsql> (raw)
In-Reply-To: <SN6PR01MB4559C457FF745D12CF79CCEBE5E70@SN6PR01MB4559.prod.exchangelabs.com>

Hi Robert,

AFAIU the problem is that when the pof tuple migrates to pot, the
partition-level FK constraint on polf sees the update as a delete
(because at that level that's what it is) and thus cascades to delete
the tuple on polf.  There is nothing that automagically instantiates a
new tuple in polt.

To fix this problem, we would need a mechanism to insert an equivalent
referencing tuple in the other partition.  I'm not sure how would we
achieve such a thing.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





view thread (5+ messages)  latest in thread

Message-ID: <20190621132823.GA8023@alvherre.pgsql>
Permalink:  ../20190621132823.GA8023@alvherre.pgsql/
Also on:    postgresql.org/message-id/20190621132823.GA8023@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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: alvherre@2ndquadrant.com, robert.rozboril@dxc.com
  Subject: Re: PostgreSQL v11.3 - Records are deleted from child table if partition key of parent table is changed
  In-Reply-To: <20190621132823.GA8023@alvherre.pgsql>
  References: <SN6PR01MB4559C457FF745D12CF79CCEBE5E70@SN6PR01MB4559.prod.exchangelabs.com> <20190621132823.GA8023@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