Re: PostgreSQL v11.3 - Records are deleted from child table if partition key of parent table is changed

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: "Rozboril, Robert" <robert(dot)rozboril(at)dxc(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: PostgreSQL v11.3 - Records are deleted from child table if partition key of parent table is changed
Date: 2019-06-21 13:28:23
Message-ID: 20190621132823.GA8023@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-06-21 13:41:42 BUG #15866: in the frontend login page of pgadmin 4 v4.8 there are several popups "Please login to access"
Previous Message Juan José Santamaría Flecha 2019-06-21 10:23:21 Re: BUG #15789: libpq compilation with OpenSSL 1.1.1b fails on Windows with Visual Studio 2017