Thread: Re: Allow NOT VALID foreign key constraints on partitioned tables.
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)
On Sat, Jan 25, 2025, at 6:00 AM, Alexander Lakhin wrote:
Hello Álvaro,Please look at the script that produces an error starting from b663b9436:
Ah yes, this is my bug: I moved a CCI where it became conditional. Will fix, thanks for the test case.
On 2025-Jan-25, Álvaro Herrera wrote: > On Sat, Jan 25, 2025, at 6:00 AM, Alexander Lakhin wrote: > > Hello Álvaro, > > > > Please look at the script that produces an error starting from b663b9436: > > Ah yes, this is my bug: I moved a CCI where it became conditional. > Will fix, thanks for the test case. Pushed the fix, thanks. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Hay quien adquiere la mala costumbre de ser infeliz" (M. A. Evans)
On Sun, Jan 26, 2025 at 10:08 PM Álvaro Herrera <alvherre@alvh.no-ip.org> wrote: > > On 2025-Jan-25, Álvaro Herrera wrote: > > > On Sat, Jan 25, 2025, at 6:00 AM, Alexander Lakhin wrote: > > > Hello Álvaro, > > > > > > Please look at the script that produces an error starting from b663b9436: > > > > Ah yes, this is my bug: I moved a CCI where it became conditional. > > Will fix, thanks for the test case. > > Pushed the fix, thanks. > Thank you ! Regards, Amul