Re: PL/pgSQL Function Help - Mailing list pgsql-general

From Michael Fuhr
Subject Re: PL/pgSQL Function Help
Date
Msg-id 20051216204231.GB8061@winnie.fuhr.org
Whole thread Raw
In response to Re: PL/pgSQL Function Help  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Fri, Dec 16, 2005 at 03:30:01PM -0500, Tom Lane wrote:
> "Niblett, David A" <niblettda@gru.com> writes:
> > Is there no way in Postgres that I can simply not return
> > anything so I show zero rows?
>
> Make the function return SETOF myrec not just myrec.  Then you
> can return zero or one (or more) myrec's.

Dunno if this indicates a possible problem, but the function as
posted fails an assertion in an assert-enabled 8.0.5 server (but
not in 8.1.1 or 8.2devel).

test=> SELECT test(0);
server closed the connection unexpectedly

#2  0x001f7e30 in ExceptionalCondition (conditionName=0x220b10 "!(typeId == ( (olddata)->t_choice.t_datum.datum_typeid
))",errorType=0x2208e0 "FailedAssertion",  
    fileName=0x220868 "tuptoaster.c", lineNumber=830) at assert.c:51
#3  0x00054ac8 in toast_flatten_tuple_attribute (value=2231056, typeId=2230496, typeMod=2230376) at tuptoaster.c:830

--
Michael Fuhr

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: PL/pgSQL Function Help
Next
From: Michael Fuhr
Date:
Subject: Re: Transacciones Anidadas