Re: Bug in CREATE FUNCTION with character type (CONFIRMED BUG) - Mailing list pgsql-bugs

From Pavel Stehule
Subject Re: Bug in CREATE FUNCTION with character type (CONFIRMED BUG)
Date
Msg-id i2s162867791004140911o52210056w17bcad777f5147e5@mail.gmail.com
Whole thread Raw
In response to Re: Bug in CREATE FUNCTION with character type (CONFIRMED BUG)  ("Kevin J Bluck" <kevin.bluck@netce.com>)
Responses Re: Bug in CREATE FUNCTION with character type (CONFIRMED BUG)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
2010/4/14 Kevin J Bluck <kevin.bluck@netce.com>:
>> I'd certainly call this a bug, if not a couple of different bugs.
>
> There seems to be more. I see a problem not just with unqualified char no=
t being treated equivalent to char(1). I also see a general problem with RE=
TURNS TABLE disregarding any explicit lengths declared for any character ty=
pe. For example, if you declare a RETURNS TABLE column as VARCHAR(15), it s=
eems to actually consider it as if you had declared it unqualified VARCHAR,=
 equivalent to TEXT. Similarly, a column defined as CHAR(2) will also be tr=
eated as unqualified CHAR without an explicit length, with the further prob=
lem reported by Pavel of being treated as unlimited length instead of equiv=
alent to CHAR(1) as expected. In other words, it seems to be effectively im=
possible to declare explicit lengths for RETURNS TABLE character type colum=
ns.
>
> This doesn't happen with the RETURNS SETOF variation, only RETURNS TABLE.
>
> Regards,

RETURNS TABLE (x int, y int) is equal to CREATE FUNCTION foo(.. OUT x
int, OUT y int) RETURNS SETOF RECORD. But PostgreSQL functions ignore
typmod for parameters - so it is not bug, it is feature :(

Pavel Stehule

>
> --- Kevin
>
>
>
>
>
> --
> Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
>

pgsql-bugs by date:

Previous
From: "Kevin J Bluck"
Date:
Subject: Re: Bug in CREATE FUNCTION with character type (CONFIRMED BUG)
Next
From: "Kevin Grittner"
Date:
Subject: Re: BUG #5421: pg_attribute broken