Re: ROWTYPE initialization question - Mailing list pgsql-general

From Jim Nasby
Subject Re: ROWTYPE initialization question
Date
Msg-id 519855AE-C271-4476-8E90-8DA42A277715@nasby.net
Whole thread Raw
In response to Re: ROWTYPE initialization question  (Alban Hertroys <alban@magproductions.nl>)
List pgsql-general
On Nov 15, 2006, at 2:07 AM, Alban Hertroys wrote:

> I suppose the real question is this: As it is not possible to
> initialize
> a %ROWTYPE type variable to NULL, is comparing it to NULL valid or
> is it
> comparing apples and oranges? Does it yield the expected result
> (true if
> the %ROWTYPE variable is undefined, false once it is defined)?
>
> It seems to work as is, but this part of PL/PgSQL seems to be a bit
> unspecific. It might as well have worked by using the FOUND special
> variable, or have yielded an error (which it didn't).
>
> Looks like I'll need to device some test cases to prove how the
> various
> subtleties behave. Now where did I put that can of time...

As far as I can tell from the code, checking a %ROWTYPE variable IS
NULL is perfectly valid. I view it as a bug that you can't assign
NULL to a %ROWTYPE variable.
--
Jim Nasby                                            jim@nasby.net
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: explain analyze taking longer than executing the query?
Next
From: Jim Nasby
Date:
Subject: Re: Discover temporary INDEX/TABLE name