From: | Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
---|---|
To: | Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | deferrable FK constraints on partitioned rels |
Date: | 2019-11-05 19:19:48 |
Message-ID: | 20191105191948.GA11182@alvherre.pgsql |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
While messing around, I noticed that SET CONSTRAINTS ... DEFERRED
does not work with partitioned tables. I had some code to cover this
case, but it has a bug that prevents it from working at all: the sanity
check that verifies whether triggers exist fails.
The attached patch fixes this problem: it merely removes the sanity
check. With that, everything works.
(Another approach I tried was to split out constraints in partitioned
tables vs. constraints in regular ones. That's indeed workable, but it
requires us to do two additional syscache access per partition for
get_rel_relkind, which seems excessive.)
The UNIQUE DEFERRABLE case works after the patch. (I didn't try without
the patch.)
--
Álvaro Herrera Developer, https://www.PostgreSQL.org/
Attachment | Content-Type | Size |
---|---|---|
0001-Fix-deferred-constraints-on-partitioned-rels.patch | text/x-diff | 2.5 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Peter Eisentraut | 2019-11-05 21:05:12 | Re: alternative to PG_CATCH |
Previous Message | David Fetter | 2019-11-05 18:41:55 | Re: [Proposal] Arbitrary queries in postgres_fdw |