Re: BUG #17869: Inconsistency between PL/pgSQL Function Parameter Handling and SQL Query Results - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #17869: Inconsistency between PL/pgSQL Function Parameter Handling and SQL Query Results
Date
Msg-id CAKFQuwZODJBFsmwABafXWhd6xCAKF8q_1EOE2xPZnPCDRcLYJw@mail.gmail.com
Whole thread Raw
In response to BUG #17869: Inconsistency between PL/pgSQL Function Parameter Handling and SQL Query Results  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
On Sunday, March 26, 2023, PG Bug reporting form <noreply@postgresql.org> wrote:
The following bug has been logged on the website:

Bug reference:      17869
Logged by:          Jiangshan Liu
Email address:      jiangshan.liu@tju.edu.cn
PostgreSQL version: 15.2
Operating system:   Ubuntu 18.04
Description:       

However, when passing fixed-length character types as parameters in PL/pgSQL
functions, the behavior seems to be different. The documentation states that
parenthesized type modifiers are discarded by CREATE FUNCTION, meaning that
CREATE FUNCTION foo (varchar(10)) is the same as CREATE FUNCTION foo
(varchar) [2].

Yet more reason for why one should restrict themself to using the text data type and forget about character as well as the length-specifying variants.

I’m doubting there is a bug here, rather a system limitation with a low motivation to try and overcome.

David J.

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #17869: Inconsistency between PL/pgSQL Function Parameter Handling and SQL Query Results
Next
From: Tom Lane
Date:
Subject: Re: BUG #17869: Inconsistency between PL/pgSQL Function Parameter Handling and SQL Query Results