PG10 transition tables, wCTEs and multiple operations on the same table

From: Marko Tiikkaja <marko(at)joh(dot)to>
To: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Kevin Grittner <kgrittn(at)ymail(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: PG10 transition tables, wCTEs and multiple operations on the same table
Date: 2017-06-02 10:48:12
Message-ID: CAL9smLCDQ=2o024rBgtD4WihzX8B3C6u_oSQ2K3+R5grJrV0bg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Since the subject of transition tables came up, I thought I'd test how this
case works:

=# create table qwr(a int);
CREATE TABLE

=# create function qq() returns trigger as $$ begin raise notice '%',
(select count(*) from oo); return null; end $$ language plpgsql;
CREATE FUNCTION

=# create trigger xx after insert on qwr referencing new table as oo for
each statement execute procedure qq();
CREATE TRIGGER

=# with t as (insert into qwr values (1)) insert into qwr values (2), (3);
NOTICE: 3
NOTICE: 3
INSERT 0 2

to me, this means that it doesn't work. Surely one of the trigger
invocations should say 1, and the other 2. Or was this intentional?

.m

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Craig Ringer 2017-06-02 10:50:15 Re: Do we need the gcc feature "__builtin_expect" to promote the branches prediction?
Previous Message Rafia Sabih 2017-06-02 10:42:22 Re: Default Partition for Range