Re: help with PL/PgSQL bug - Mailing list pgsql-hackers

From Neil Conway
Subject Re: help with PL/PgSQL bug
Date
Msg-id 1042250788.743.95.camel@tokyo
Whole thread Raw
In response to Re: help with PL/PgSQL bug  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: help with PL/PgSQL bug  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, 2003-01-10 at 20:28, Tom Lane wrote:
> The core dump appears to occur when the SELECT INTO fails to retrieve
> a row, leaving "finalrec" undefined.

Thanks very much for your help, Tom.

> Clearly, RETURN NEXT with an undefined record variable shouldn't dump
> core, but what should it do? Raise an error, or perhaps be a no-op?

I'd vote for making it a no-op. Raising an error is too severe for a
fairly routine occurence, IMHO. If we make it a no-op, it's consistent
with how I understand a SELECT INTO of 0 rows -- it doesn't produce an
"undefined value", but an "empty result set" (like the difference
between "" and a NULL pointer).

Cheers,

Neil
-- 
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC





pgsql-hackers by date:

Previous
From: Laurette Cisneros
Date:
Subject: Re: 7.3 pg_dump with -Fc option crashes
Next
From: Tom Lane
Date:
Subject: Re: help with PL/PgSQL bug