From: Richard Guo <guofenglinux@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: tlhquynh@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18589: pg_get_viewdef returns wrong query
Date: Thu, 29 Aug 2024 15:19:43 +0800
Message-ID: <CAMbWs4_AP5Rrw8bc3N+E_fUVKc3_AWZexyWJRujRFyM-CcPyYg@mail.gmail.com> (raw)
In-Reply-To: <3465444.1724871808@sss.pgh.pa.us>
References: <18589-70091cb81db1a3f1@postgresql.org>
<CAMbWs4_nMJ8uXMxd8T7eUh3DbNa9DbNM9_CpuQN5Yk74SUaEEg@mail.gmail.com>
<2906775.1724692311@sss.pgh.pa.us>
<CAMbWs4_D7CVSxJVmQQA+5KWz9XxqOpEKgQvE9Pfoc8pXPwJNTw@mail.gmail.com>
<3094457.1724769753@sss.pgh.pa.us>
<3465444.1724871808@sss.pgh.pa.us>
On Thu, Aug 29, 2024 at 3:03 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I was just about to commit v2 when I realized that it's wrong, because
> what we need to be checking against is the output column name(s) that
> get_target_list() will print, and that's not necessarily tle->resname.
> You can in fact make v2 misbehave with ALTER VIEW RENAME COLUMN, as
> shown by the added test cases in attached v3.
Ah yes, we need to match the column name from the view's tuple
descriptor, which may differ from tle->resname after column RENAME.
+1 to v3.
Thanks
Richard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: guofenglinux@gmail.com, tgl@sss.pgh.pa.us, tlhquynh@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #18589: pg_get_viewdef returns wrong query
In-Reply-To: <CAMbWs4_AP5Rrw8bc3N+E_fUVKc3_AWZexyWJRujRFyM-CcPyYg@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox