Re: PL/pgSQL nested CALL with transactions

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PL/pgSQL nested CALL with transactions
Date: 2018-03-16 17:50:49
Message-ID: CAFj8pRCF7o2d-YZheXJnNdNz8+SR_gTveBC=65v1=giG_eOyMQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2018-03-16 18:49 GMT+01:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> > 2018-03-16 18:35 GMT+01:00 Peter Eisentraut <
> > peter(dot)eisentraut(at)2ndquadrant(dot)com>:
> >> Not very typical, but we apply the same execution context handling to
> >> CALL and DO at the top level, so it would be weird not to propagate
> that.
>
> > Although it is possible, I don't see any sense of introduction for DO
> into
> > plpgsql. Looks like duplicate to EXECUTE.
>
> Not sure what you think is being "introduced" here. It already works just
> like any other random SQL command:
>
> regression=# do $$
> regression$# begin
> regression$# raise notice 'outer';
> regression$# do $i$ begin raise notice 'inner'; end $i$;
> regression$# end $$;
> NOTICE: outer
> NOTICE: inner
> DO
>
> While certainly that's a bit silly as-is, I think it could have practical
> use if the inner DO invokes a different PL.
>

ok, make sense

Pavel

>
> regards, tom lane
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2018-03-16 18:21:06 Re: ON CONFLICT DO UPDATE for partitioned tables
Previous Message Ashutosh Bapat 2018-03-16 17:50:37 Re: [HACKERS] Partition-wise aggregation/grouping