| From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
|---|---|
| To: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> |
| Cc: | assam258(at)gmail(dot)com, Ayush Tiwari <ayushtiwari(dot)slg01(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
| Subject: | Re: [DEPARSE] EXPLAIN prints another ModifyTable's RETURNING aliases in a SubPlan |
| Date: | 2026-10-22 14:30:59 |
| Message-ID: | 2303148.1792679459@sss.pgh.pa.us |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com> writes:
> Another option would be to print "y.a, OLD.a, t.b". Putting "OLD" in
> capitals, without double-quotes, makes it clear that it's a special
> keyword, and it can't clash with a table alias, because a capitalised
> table alias would be double-quoted.
Well, actually not, because EXPLAIN will double-quote it anyway:
Update on public.t
Output: y.a, "OLD".a, t.b
Still, this is probably an improvement on your previous suggestion.
But I think we are putting too much emphasis on this example.
Reality is that if the same alias is specified in both the rule and
the outer query, there is *nothing* we can print that won't be
ambiguous/confusing. That's self-inflicted damage really, and
I'm not very impressed by the argument that two different people
might've written the rule and the query. So I'd rather focus on
what happens when people avoid duplicate aliases, and make sure
that we print names that are as useful as possible in that case.
regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | David Geier | 2026-10-22 14:53:09 | Re: Hash a ScalarArrayOpExpr whose array is fixed for one execution |
| Previous Message | Sho Ito | 2026-10-22 14:27:21 | Re: [PATCH v1] Fix tab completion for DROP INDEX CONCURRENTLY |