Re: Terminating a SETOF function call sequence - Mailing list pgsql-hackers

From John Hansen
Subject Re: Terminating a SETOF function call sequence
Date
Msg-id 5066E5A966339E42AA04BA10BA706AE56250@rodrick.geeknet.com.au
Whole thread Raw
In response to Terminating a SETOF function call sequence  (Thomas Hallgren <thhal@mailblocks.com>)
Responses Re: Terminating a SETOF function call sequence
List pgsql-hackers
> ... c) would be very bad since it
> doesn't give me any chance to release the resources that
> where used in order to produce the rows.

You are supposed to free resources used to produce the rows before srf_return_next();
The actual rows are pfree()'d by pg. (an dso are any other palloc()'d resources, but I'd recommend freeing them anyway,
especiallyif youre going to use the function in an index or transactions, since resources a not freed till the end of
thetransaction) 

... JOhn


pgsql-hackers by date:

Previous
From: Christopher Kings-Lynne
Date:
Subject: Re: Strange RETURN NEXT behaviour in Postgres 8.0
Next
From: "Magnus Hagander"
Date:
Subject: Re: win32 performance - fsync question