On Mon, Mar 23, 2015 at 10:51 AM, Tom Lane <t...@sss.pgh.pa.us> wrote:
> Ashutosh Bapat <ashutosh.ba...@enterprisedb.com> writes: > > On Sun, Mar 22, 2015 at 6:32 AM, Tom Lane <t...@sss.pgh.pa.us> wrote: > >> What I'm imagining instead is that when there's more than one > >> target relation, we produce output like ... > > > This looks better. > > In the format above, you have specified both the Remote SQL for scan as > > well as update but in the example you have only mentioned only Remote SQL > > for update; it may be part of "... etc ...". It's better to provide both. > > Hm? We don't have scan nodes that read more than one table, so I'm > not following your point. > > regards, tom lane > In the format you specified Multi-Table Update Relation Name: pt1 -- this is the *nominal* target Target Relations: [ Relation Name: pt1 -- first actual target Schema: public Alias: pt1 ] [ Relation Name: ft1 Schema: public Alias: ft1 Remote SQL: UPDATE ref1 ... ] Plans: Plan: (seq scan on pt1 here) Plan: (foreign scan on ft1 here) For relation ft1, there is an Update node as well as a scan node. Update node has Update Remote SQL and Scan will have corresponding SELECT Remote SQL. But in the text output you gave Update on public.pt1 (cost=0.00..321.05 rows=3541 width=46) Update on public.pt1 Foreign Update on public.ft1 Remote SQL: UPDATE public.ref1 SET c1 = $2 WHERE ctid = $1 Foreign Update on public.ft2 Remote SQL: UPDATE public.ref2 SET c1 = $2 WHERE ctid = $1 Update on public.child3 -> Seq Scan on public.pt1 (cost=0.00..0.00 rows=1 width=46) Output: (pt1.c1 + 1), pt1.c2, pt1.c3, pt1.ctid ... etc ... For ft1 there is only Update Remote SQL. whereas for child3 you have specified the Seq Scan as well. I was wondering if the foreign scan on ft1 is part of "...etc..."?. Further we have to make it clear which scan goes with which Update, either by listing the scans in the same order as updates or by associating each scan with corresponding update. -- Best Wishes, Ashutosh Bapat EnterpriseDB Corporation The Postgres Database Company