Re: Allow NOT VALID foreign key constraints on partitioned tables.

Amul Sul <sulamul@gmail.com>

From: Amul Sul <sulamul@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Álvaro Herrera <alvherre@alvh.no-ip.org>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2025-01-24T10:50:00Z
Lists: pgsql-hackers

Attachments

On Fri, Jan 24, 2025 at 7:46 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> =?utf-8?Q?=C3=81lvaro?= Herrera <alvherre@alvh.no-ip.org> writes:
> > OK thanks, looks good, I have pushed it now with some trivial
> > amendments.
>
> Looks like some of the queries need ORDER BY for stability.
>
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=morepork&dt=2025-01-23%2023%3A35%3A57
>

Attached is the patch to fix this. Apologies for the sloppy work, and
thanks for pointing it out.

Regards,
Amul

Commits

  1. Add missing CommandCounterIncrement

  2. Fix instability in recently added regression tests

  3. Allow NOT VALID foreign key constraints on partitioned tables

  4. Split ATExecValidateConstraint into reusable pieces