Re: [HACKERS] PG10 transition tables, wCTEs and multiple operationson the same table

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: [HACKERS] PG10 transition tables, wCTEs and multiple operationson the same table
Дата
Msg-id CAEepm=3-4Cm+Jszw_-+yiMOz4NuU05vSZTj0zkk=wC_qQE_zmg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [HACKERS] PG10 transition tables, wCTEs and multiple operationson the same table  (Thomas Munro <thomas.munro@enterprisedb.com>)
Ответы Re: [HACKERS] PG10 transition tables, wCTEs and multiple operationson the same table  (Thomas Munro <thomas.munro@enterprisedb.com>)
Список pgsql-hackers
On Thu, Jun 8, 2017 at 11:05 AM, Thomas Munro
<thomas.munro@enterprisedb.com> wrote:
> 1.  Keep the current behaviour. [...]
>
> 2.  Make a code change that would split the 'new table' tuplestore in
> two: an insert tuplestore and an update tuplestore (for new images;
> old images could remain in the old tuplestore that is also used for
> deletes) as Peter suggests.  That raises two questions for me: (1)
> Does it really make sense for the 'when' clause, which sounds like it
> only controls when we fire a trigger, also to affect which transition
> tuples it sees?  There is something slightly fishy about that.  (2)
> Assuming yes, should an AFTER INSERT OR UPDATE trigger see the union
> of the the two tuplestores?  Trigger authors would need to be aware a
> single statement can produce a mixture of updates and inserts, but
> only if they explicitly invite such problems into their lives with
> that incantation.

A third option would be for an AFTER INSERT OR UPDATE trigger to be
invoked twice, once for the inserts and once again for the updates.
No union required, but also surprising.

Any other ideas?

-- 
Thomas Munro
http://www.enterprisedb.com



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Thomas Munro
Дата:
Сообщение: Re: [HACKERS] PG10 transition tables, wCTEs and multiple operationson the same table
Следующее
От: Amit Langote
Дата:
Сообщение: Re: [HACKERS] BEFORE trigger can cause undetected partitionconstraint violation