Re: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query
Date
Msg-id CAKFQuwaRY_x3XXnhpi3Q6NcUAsW9aMRAcEwRtxb8kDDjk1fKvA@mail.gmail.com
Whole thread Raw
In response to Re: Ynt: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
On Sunday, February 9, 2025, Tom Lane <tgl@sss.pgh.pa.us> wrote:
 
You could however make a reasonable case that we should not accept
"varchar(200)" in contexts where we're going to ignore the "(200)"
part.  That's pretty ancient too, cf this comment in gram.y:

 * We can catch over-specified arguments here if we want to,
 * but for now better to silently swallow typmod, etc.
 * - thomas 2000-03-22

I'm not sure whether rejecting such things would make more people
happy than it made unhappy.

Given that pg_dump already outputs the typmod-less code I’d have to suspect that making specifying a typmod here an error would be better for our reputation, and users, overall.

David J.

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Ynt: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query
Next
From: 濱中 弘和
Date:
Subject: BUG #18773: オートバキュームのリトライ時にreltuplesの値が減少する