Re: Remove mention in docs that foreign keys on partitioned tablesare not supported - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Remove mention in docs that foreign keys on partitioned tablesare not supported
Date
Msg-id cc95fb54-4c02-f0e6-46eb-e587a96eaf0f@2ndquadrant.com
Whole thread Raw
In response to Re: Remove mention in docs that foreign keys on partitioned tables are not supported  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 6/4/18 16:50, Tom Lane wrote:
> Perhaps, but I'm having a hard time wrapping my mind around what the
> semantics ought to be.  If a trigger on partition A changes the keys
> so that the row shouldn't have gone into A at all, what then?  That
> trigger should never have fired, eh?

The insert will result in an error and everything is rolled back, so you
do kind of get the "should never have" behavior.

It seems we ultimately have to answer the question whether we want
BEFORE triggers executed before or after tuple routing.  Both behaviors
might be useful, so perhaps we'll need two kinds of triggers.

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Remove mention in docs that foreign keys on partitioned tablesare not supported
Next
From: Tom Lane
Date:
Subject: Re: Remove mention in docs that foreign keys on partitioned tables are not supported