Re: Adding OLD/NEW support to RETURNING
Dean Rasheed <dean.a.rasheed@gmail.com>
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Richard Guo <guofenglinux@gmail.com>
Cc: jian he <jian.universality@gmail.com>, Robert Treat <rob@xzilla.net>, Jeff Davis <pgsql@j-davis.com>,
PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, Tomas Vondra <tomas@vondra.me>
Date: 2025-01-17T10:44:03Z
Lists: pgsql-hackers
On Fri, 17 Jan 2025 at 02:24, Richard Guo <guofenglinux@gmail.com> wrote: > > It seems that adding ParseNamespaceItems for the OLD or NEW aliases > may confuse scanNameSpaceForRelid() when searching the table namespace > for a relation item. Since they contain the same RTE, > scanNameSpaceForRelid() might mistakenly detect multiple matches. > > create table t (a int, b int); > > update public.t set a = 1 returning public.t.b; > ERROR: table reference 46337 is ambiguous > LINE 1: update public.t set a = 1 returning public.t.b; > ^ Thanks. I hadn't tested qualified table names in the RETURNING list. I've pushed a fix for that. Regards, Dean
Commits
-
doc: Updates for RETURNING OLD/NEW.
- 3ba9639e39ed 18.0 landed
-
Fix parsing of qualified relation names in RETURNING.
- 43830ecb8a9b 18.0 landed
-
Add OLD/NEW support to RETURNING in DML queries.
- 80feb727c869 18.0 landed
-
Remove useless casts to (void *)
- 7f798aca1d5d 18.0 cited
-
Refactor/reword some error messages to avoid duplicates
- 2bb969f39984 18.0 cited