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

From: Alexander Lakhin <exclusion(at)gmail(dot)com>
To: Álvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Amul Sul <sulamul(at)gmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Allow NOT VALID foreign key constraints on partitioned tables.
Date: 2025-01-25 05:00:01
Message-ID: c599253c-1ccd-4161-80fc-c9065e037a09@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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)

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2025-01-25 05:00:22 Re: Add CASEFOLD() function.
Previous Message Peter Geoghegan 2025-01-25 03:38:21 Re: Adding skip scan (including MDAM style range skip scan) to nbtree