From: | Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> |
---|---|
To: | Kevin J Bluck <technology(at)netce(dot)com> |
Cc: | "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org> |
Subject: | Re: Bug in CREATE FUNCTION with character type (CONFIRMED BUG) |
Date: | 2010-04-14 16:11:09 |
Message-ID: | i2s162867791004140911o52210056w17bcad777f5147e5@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
2010/4/14 Kevin J Bluck <kevin(dot)bluck(at)netce(dot)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 not being treated equivalent to char(1). I also see a general problem with RETURNS TABLE disregarding any explicit lengths declared for any character type. For example, if you declare a RETURNS TABLE column as VARCHAR(15), it seems 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 treated as unqualified CHAR without an explicit length, with the further problem reported by Pavel of being treated as unlimited length instead of equivalent to CHAR(1) as expected. In other words, it seems to be effectively impossible to declare explicit lengths for RETURNS TABLE character type columns.
>
> 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(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-bugs
>
From | Date | Subject | |
---|---|---|---|
Next Message | Kevin Grittner | 2010-04-14 16:13:31 | Re: BUG #5421: pg_attribute broken |
Previous Message | Tom Lane | 2010-04-14 15:32:16 | Re: BUG #5412: test case produced, possible race condition. |