Re: Another FK violation when referencing a multi-level partitioned table

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Jehan-Guillaume de Rorthais <jgdr@dalibo.com>
Cc: pgsql-bugs@lists.postgresql.org
Date: 2020-02-06T08:08:33Z
Lists: pgsql-bugs
On Thu, Feb 06, 2020 at 12:49:48AM +0100, Jehan-Guillaume de Rorthais wrote:
> Please, find in attachment a proposal patch to fix this FK violation.

Indeed.  I would have expected the deletion of the referenced rows to
happen as in your test.  At quick glance, your fix looks right, but I
need to study more this code.  Alvaro, would you like to weigh in as
the author of f56f8f8?
--
Michael

Commits

  1. Simplify FK-to-partitioned regression test query

  2. Fix failure to create FKs correctly in partitions