From: 德哥 <digoal@126.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: Re:Re: BUG #16702: inline code and function : when use dynamic name for rowtype, there is some bug!
Date: Mon, 9 Nov 2020 21:49:04 +0800 (CST)
Message-ID: <5b81a119.63f0.175ad446e65.Coremail.digoal@126.com> (raw)
In-Reply-To: <CAKFQuwb66ajp6rTk8hJc+jiaQM08321+RkEkwnuc8o290CAtjA@mail.gmail.com>
References: <16702-f82c1f74d5042413@postgresql.org>
<CAKFQuwb66ajp6rTk8hJc+jiaQM08321+RkEkwnuc8o290CAtjA@mail.gmail.com>
The customer originally used Oracle. Oracle supports using the table name in the variable name instead, while using the rowType corresponding to the table name of the variable name.
However, in PostgreSQL with the variable % RowType, compilation can pass if the variable has the same name as an existing table. The table name corresponding to the value of the variable name is used as rowType.
However, when the variable name cannot find the table name with the same name, the compilation error is directly reported, which is inconsistent with Oracle.
I think this is a bug, the reason has nothing to do with Oracle, but the execution behavior is biased, either do not replace the value of the variable during the execution, but directly use the table name corresponding to the variable name.
Best regards,
digoal
--
公益是一辈子的事,I'm Digoal,Just Do It.
在 2020-11-05 22:15:45,"David G. Johnston" <david.g.johnston@gmail.com> 写道:
On Wednesday, November 4, 2020, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:
Bug reference: 16702
Logged by: Zhou Digoal
Email address: digoal@126.com
PostgreSQL version: 12.4
Operating system: CentOS 7.7 x64
Description:
postgresql 12, when i use dynamic name for rowtype, there is some bug!
b y%rowtype;
Rowtype gets attached to an identifier, which must also be a relation. In PostgreSQL, identifiers cannot be variable.
David J.
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: digoal@126.com, david.g.johnston@gmail.com, pgsql-bugs@lists.postgresql.org
Subject: Re:Re: BUG #16702: inline code and function : when use dynamic name for rowtype, there is some bug!
In-Reply-To: <5b81a119.63f0.175ad446e65.Coremail.digoal@126.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