Re: PL/pgSQL Function Help

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Niblett, David A" <niblettda(at)gru(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: PL/pgSQL Function Help
Date: 2005-12-16 20:42:31
Message-ID: 20051216204231.GB8061@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-general

On Fri, Dec 16, 2005 at 03:30:01PM -0500, Tom Lane wrote:
> "Niblett, David A" <niblettda(at)gru(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Pierre Girard 2005-12-16 21:35:57 Re: Solaris cc compiler on amd: PostgreSQL does not have native
Previous Message Tom Lane 2005-12-16 20:30:01 Re: PL/pgSQL Function Help

Browse pgsql-general by date

  From Date Subject
Next Message Carlos Benkendorf 2005-12-16 20:49:32 Re: Fetch statements
Previous Message Jaime Casanova 2005-12-16 20:35:13 Re: [GENERAL] Transacciones Anidadas