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: Ugur Yilmaz <ugurlu2001(at)hotmail(dot)com>
Cc: "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-09 23:13:26
Message-ID: CAKFQuwZy-JU0tAWYd=6OheZci8OEXVx99J6eSH=hV3z0=OZfmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Sun, Feb 9, 2025 at 3:53 PM Ugur Yilmaz <ugurlu2001(at)hotmail(dot)com> wrote:

> First of all, I want to show the subject from a different perspective. The
> situation I am experiencing is a short summary of this perspective. In my
> development environment, the Varchar(n) type is normally displayed as an
> "Application Interface - Grid Display" up to the 254 character limit. If
> the Varchar(indeterminate length) case is the case, the data remains
> embedded in a "Memo pre-declaration" definition. In other words, the user
> cannot view the data directly.
>

I am familiar with this interpretation of the meta-data. It is
indeed annoying that there is no satisfying solution to this. IMO the UI
should just detect the presence/absence of a newline in the data and render
the specific cell accordingly.

>
> * I’ll wait for a “minimal reproducer” to dive into specifics if there are
> still questions. : Do I need to provide you with examples on this or a
> remote connection for my own development environment? I can collaborate as
> you need.
>

You would need to write such a script; but it doesn't seem necessary.
You've made your need clear and have a clear answer.

> * If the absence of the typmod as it is called (the (n)) is a problem
> there isn’t a change forthcoming to rework that part of the system. It’s a
> limitation we are living with. : As far as I can see, no changes or updates
> are planned for the current situation and the current situation will
> continue as it is..
>

Correct.

> Thank you for the explanations and information. Although I find your
> answers convincing; I still can't understand why I can't get the desired
> result from the Varchar(n) type, whose -max- length I explicitly specified
> in the "Returns Table" statement.
>

I'm not sure I understand why as well, but unless I was intent on producing
a patch to overcome the limitation the why of it is immaterial to me.

David J.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2025-02-09 23:19:27 Re: Ynt: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query
Previous Message Ugur Yilmaz 2025-02-09 22:34:35 Ynt: BUG #18793: PLpgSQL Function Returning Type of Table is not match for varchar(n) data type via Return Query