Thread: Function results written to memory, then sent?

Function results written to memory, then sent?

From
"Steve - DND"
Date:
I was reading through the docs today, and came across a paragraph that
indicated when plpgsql queries are executed on the server, the results are
all written to memory(or disk if necessary), and not streamed as available.
I can't find the doc page which said it, but does anyone know if this
applies to regular SQL as well, or is it just plpgsql specific. If it
applies to either or both, are there any current plans to not have PG not
behave in this manner, and stream the results of a query as they become
available?

Thanks,
Steve



Re: Function results written to memory, then sent?

From
Alvaro Herrera
Date:
On Mon, Mar 14, 2005 at 11:35:12PM -0700, Steve - DND wrote:
> I was reading through the docs today, and came across a paragraph that
> indicated when plpgsql queries are executed on the server, the results are
> all written to memory(or disk if necessary), and not streamed as available.
> I can't find the doc page which said it, but does anyone know if this
> applies to regular SQL as well, or is it just plpgsql specific. If it
> applies to either or both, are there any current plans to not have PG not
> behave in this manner, and stream the results of a query as they become
> available?

It is only plpgsql.  Pl/pgsql uses the C interface, which allows both
things to happen (so you can write a function in C which does one thing
or the other).  SQL is implemented internally (not through the C
interface) and streams the results as they are available.

--
Alvaro Herrera (<alvherre[@]dcc.uchile.cl>)
"When the proper man does nothing (wu-wei),
his thought is felt ten thousand miles." (Lao Tse)