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

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ugur Yilmaz <ugurlu2001(at)hotmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query
Date: 2025-02-10 00:55:01
Message-ID: CAKFQuwaRY_x3XXnhpi3Q6NcUAsW9aMRAcEwRtxb8kDDjk1fKvA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sunday, February 9, 2025, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Munro 2025-02-10 03:21:59 Re: BUG #18795: Norwegian bokmål crashes again
Previous Message Ugur Yilmaz 2025-02-10 00:21:34 Ynt: Ynt: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query