Re: FOR EACH ROW triggers on partitioned tables

Поиск
Список
Период
Сортировка
Искать
От
Peter Eisentraut
Тема
Re: FOR EACH ROW triggers on partitioned tables
Дата
Msg-id
812dce79-717e-6905-afee-8c3cb27aab1a@2ndquadrant.com
Ответ на
Список
Дерево обсуждения
FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: FOR EACH ROW triggers on partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [Sender Address Forgery]Re: FOR EACH ROW triggers on partitionedtables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: FOR EACH ROW triggers on partitioned tables Robert Haas <robertmhaas@gmail.com>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Robert Haas <robertmhaas@gmail.com>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Thomas Munro <thomas.munro@enterprisedb.com>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Re: FOR EACH ROW triggers on partitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: FOR EACH ROW triggers on partitioned tables Thomas Munro <thomas.munro@enterprisedb.com>
Re: FOR EACH ROW triggers on partitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Amit Langote <amitlangote09@gmail.com>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: FOR EACH ROW triggers on partitioned tables Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: FOR EACH ROW triggers on partitioned tables Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: FOR EACH ROW triggers on partitioned tables Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
Re: FOR EACH ROW triggers on partitioned tables Simon Riggs <simon@2ndquadrant.com>
On 2/15/18 16:55, Alvaro Herrera wrote:
> Amit Langote wrote:
>> Do you mean to fire these triggers only if the parent table (not a child
>> table/partition) is addressed in the DML, right?  If the table directly
>> addressed in the DML is a partition whose parent has a row-level trigger,
>> then that trigger should not get fired I suppose.
> 
> No, I think that would be strange and cause data inconsistencies.
> Inserting directly into the partition is seen as a performance
> optimization (compared to inserted into the partitioned table), so we
> don't get to skip firing the triggers defined on the parent because the
> behavior would become different.  In other words, the performance
> optimization breaks the database.
> 
> Example: suppose the trigger is used to maintain an audit record trail.

Although this situation could probably be addressed by not giving
permission to write directly into the partitions, I can't think of an
example where one would want a trigger that is only fired when writing
into the partition root rather than into the partition directly.

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

В списке pgsql-hackers по дате отправления
От: Peter Eisentraut
Дата:
Сообщение: Re: rename sgml files?
От: Peter Eisentraut
Дата:
FAQ