Re: When is a record NULL? - Mailing list pgsql-hackers

From David E. Wheeler
Subject Re: When is a record NULL?
Date
Msg-id 5BE64390-BB4B-4FCC-B3CF-4853471429D3@kineticode.com
Whole thread Raw
In response to Re: When is a record NULL?  ("Eric B. Ridge" <ebr@tcdi.com>)
Responses Re: When is a record NULL?  (David E. Wheeler <david@kineticode.com>)
List pgsql-hackers
On Jul 26, 2009, at 4:02 PM, Eric B. Ridge wrote:

> I'm just a random lurker, but FOUND seems to work just fine (I  
> suppose it's PG-specific?).
>
> http://www.postgresql.org/docs/8.1/static/plpgsql-statements.html#PLPGSQL-STATEMENTS-DIAGNOSTICS
>
> BEGIN
>   OPEN stuff;
>   FETCH stuff INTO rec;
>   WHILE FOUND LOOP
>      RETURN NEXT rec;
>      FETCH stuff INTO rec;
>   END LOOP;
> END;

Yep, that's just what I needed, thanks. I think I'll send a patch for  
the "Cursors" section of the PL/pgSQL documentation that mentions  
this. Would have saved me a bunch of hassle.

Best,

David



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: WIP: Deferrable unique constraints
Next
From: Devrim GÜNDÜZ
Date:
Subject: Re: SRPMs?