Re: Bug in CREATE FUNCTION with character type (CONFIRMED BUG)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Kevin J Bluck <technology(at)netce(dot)com>, "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 22:12:34
Message-ID: 15735.1271283154@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> 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 :(

Yeah. Or at least, this is not something that can be changed without a
great deal of work --- and application breakage, more than likely.

You could possibly get the length to be enforced by storing into a local
variable of the record type before returning it. I think plpgsql does
account for typmod when assigning to locals.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2010-04-14 22:40:22 Re: BUG #5416: int4inc() is wrong
Previous Message Tom Lane 2010-04-14 22:07:21 Re: Bug in CREATE FUNCTION with character type