Re: Bug in detaching a partition with a foreign key. - Mailing list pgsql-hackers

From Sami Imseih
Subject Re: Bug in detaching a partition with a foreign key.
Date
Msg-id CAA5RZ0sJumidvHS-gjsurbuEJhZEPN1UyHM=yVuVqvCzFrkpOg@mail.gmail.com
Whole thread Raw
In response to Re: Bug in detaching a partition with a foreign key.  (Álvaro Herrera <alvherre@alvh.no-ip.org>)
List pgsql-hackers
The patch that Amul and I wrote both achieve the same result.
The approach that Amul took builds a list of constraint OIDs,
which could grow with the number of partitions and foreign keys
on those partitions. Maybe not a big deal?

In my suggestion [1], I just do one extra pg_constraint lookup
to determine If the relation on the parent and child constraint match,
and in that case we can skip the rest of the work to cut the
link as it's not needed.

Regards,

Sami

[1] https://www.postgresql.org/message-id/CAA5RZ0vk4SJ9PiD2RyG-CKOYvOFewz6QweKcp2_EegBKns%3DdOA%40mail.gmail.com



pgsql-hackers by date:

Previous
From: Álvaro Herrera
Date:
Subject: Re: Bug in detaching a partition with a foreign key.
Next
From: Corey Huinker
Date:
Subject: Re: Statistics Import and Export