Re: Bug in detaching a partition with a foreign key.

Alvaro Herrera <alvherre@alvh.no-ip.org>

From: Álvaro Herrera <alvherre@alvh.no-ip.org>
To: Sami Imseih <samimseih@gmail.com>
Cc: Amul Sul <sulamul@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2025-01-21T09:44:51Z
Lists: pgsql-hackers
On 2025-Jan-20, Sami Imseih wrote:

> Patch looks good to me, but I am not sure about this part of the comment:
> 
> "Only the topmost one is to be considered here; the child constraints
> must be left alone,"
> 
> In this case, none of the pg_constraint entries are actually considered. right?

Right.  The parent one because it has conparentid = 0, the others
because their parent constraint is in the list.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/



Commits

  1. Fix detach of a partition that has a toplevel FK to a partitioned table