Ian Lance Taylor wrote:
> Camm Maguire <camm@enhanced.com> writes:
>
> > Greetings! Just read that this functionality is planned for the
> > future. Can 7.1 have cursors in pgsql functions, for example?
>
> No, it can't.
>
> I have a patch which adds support for cursors in PL/pgSQL. If anybody
> is interested, I can provide that patch against either 7.0.3 or the
> current CVS sources. I have sent it to the maintainers, and they will
> consider it after the 7.1 release.
The one patch I've seen on this topic simply added some
CURSOR syntax to the PL/pgSQL parser, but did it with a
regular SPI query in the background. I object that'd be a
good idea, because it let's ppl think they're using a cursor,
test their functions against test data and assume they'll
still work if selecting a couple of million rows at once in
production. That wouldn't be true, because the backend might
run out of memory, what they wanted to avoid by using the
cursor in the first place.
So if we provide CURSOR syntax in PL's, we should provide the
real functionality as well.
Jan
--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck@Yahoo.com #
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com