Re:Re: BUG #16702: inline code and function : when use dynamic name for rowtype, there is some bug! - Mailing list pgsql-bugs

From 德哥
Subject Re:Re: BUG #16702: inline code and function : when use dynamic name for rowtype, there is some bug!
Date
Msg-id 5b81a119.63f0.175ad446e65.Coremail.digoal@126.com
Whole thread Raw
In response to Re: BUG #16702: inline code and function : when use dynamic name for rowtype, there is some bug!  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Re: BUG #16702: inline code and function : when use dynamic name for rowtype, there is some bug!
Re: Re: BUG #16702: inline code and function : when use dynamic name for rowtype, there is some bug!
List pgsql-bugs


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.
 

pgsql-bugs by date:

Previous
From: Amit Kapila
Date:
Subject: Re: BUG #16643: PG13 - Logical replication - initial startup never finishes and gets stuck in startup loop
Next
From: Pavel Stehule
Date:
Subject: Re: Re: BUG #16702: inline code and function : when use dynamic name for rowtype, there is some bug!