Re: Allow NOT VALID foreign key constraints on partitioned tables. - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: Allow NOT VALID foreign key constraints on partitioned tables.
Date
Msg-id c599253c-1ccd-4161-80fc-c9065e037a09@gmail.com
Whole thread Raw
Responses Re: Allow NOT VALID foreign key constraints on partitioned tables.
List pgsql-hackers
Hello Álvaro,

23.01.2025 17:04, Álvaro Herrera wrote:
> OK thanks, looks good, I have pushed it now with some trivial
> amendments.

Please look at the script that produces an error starting from b663b9436:
CREATE TABLE st (a int, primary key (a));
CREATE TABLE pt (a int,
   FOREIGN KEY (a) REFERENCES st ON DELETE SET NULL ON UPDATE SET NULL,
   FOREIGN KEY (a) REFERENCES st ON DELETE SET NULL ON UPDATE SET NULL
) PARTITION BY LIST (a);
CREATE TABLE tp1 PARTITION OF pt FOR VALUES IN (1, 2);
ALTER TABLE pt DETACH PARTITION tp1;
ALTER TABLE pt ATTACH PARTITION tp1 FOR VALUES IN (1, 2);

ERROR:  XX000: tuple already updated by self
LOCATION:  simple_heap_update, heapam.c:4374

Best regards,
Alexander Lakhin
Neon (https://neon.tech)



pgsql-hackers by date:

Previous
From: Peter Geoghegan
Date:
Subject: Re: Adding skip scan (including MDAM style range skip scan) to nbtree
Next
From: Tom Lane
Date:
Subject: Re: Add CASEFOLD() function.