Re: Adding OLD/NEW support to RETURNING - Mailing list pgsql-hackers

From Dean Rasheed
Subject Re: Adding OLD/NEW support to RETURNING
Date
Msg-id CAEZATCVX2o0KP2ZKiROKB0cWGMGU_PVHiDk+jf2kCr0MH0dtzg@mail.gmail.com
Whole thread Raw
In response to Re: Adding OLD/NEW support to RETURNING  (Richard Guo <guofenglinux@gmail.com>)
List 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



pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: Change GUC hashtable to use simplehash?
Next
From: Ranier Vilela
Date:
Subject: Re: Fix misuse use of pg_b64_encode function (contrib/postgres_fdw/connection.c)