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

From Ashutosh Bapat
Subject Re: Remove mention in docs that foreign keys on partitioned tablesare not supported
Date
Msg-id CAFjFpRcbD4Lkt0Rnv+vy1DDkSHBENM7q8LG3AzAY187fy4RFVQ@mail.gmail.com
Whole thread Raw
In response to Re: Remove mention in docs that foreign keys on partitioned tablesare not supported  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Remove mention in docs that foreign keys on partitioned tablesare not supported
Re: Remove mention in docs that foreign keys on partitioned tablesare not supported
List pgsql-hackers
On Sat, Jun 16, 2018 at 9:29 AM, Robert Haas <robertmhaas@gmail.com> wrote:
>
> By that logic, we should not have suggested that anyone use table
> inheritance, because they would have to change their configuration
> when we implemented table partitioning.  Indeed, switching from table
> inheritance to table partitioning is much more intrusive than dropping
> triggers on individual partitions and adding one on the partitioned
> table.  The latter only requires DDL on existing objects, but the
> former requires creating entirely new objects and moving all of your
> data.

That's a wrong comparison. Inheritance based partitioning works even
after declarative partitioning feature is added. So, users can
continue using inheritance based partitioning if they don't want to
move to declarative partitioning. That's not true here. A user creates
a BEFORE ROW trigger on each partition that mimics partitioned table
level BEFORE ROW trigger. The proposed BEFORE ROW trigger on
partitioned table will cascade the trigger down to each partition. If
that fails to recognize that there is already an equivalent trigger, a
partition table will get two triggers doing the same thing silently
without any warning or notice. That's fine if the trigger changes the
salaries to $50K but not OK if each of those increases salary by 10%.
The database has limited ability to recognize what a trigger is doing.

-- 
Best Wishes,
Ashutosh Bapat
EnterpriseDB Corporation
The Postgres Database Company


pgsql-hackers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: [HACKERS] GUC for cleanup indexes threshold.
Next
From: Thomas Munro
Date:
Subject: Re: Add function to release an allocated SQLDA