Re: Cursors in SPI functions/procedures - Mailing list pgsql-general

From Jan Wieck
Subject Re: Cursors in SPI functions/procedures
Date
Msg-id 200102061041.FAA00968@jupiter.greatbridge.com
Whole thread Raw
In response to Re: Cursors in SPI functions/procedures  (Ian Lance Taylor <ian@airs.com>)
List pgsql-general
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


pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Re: new type proposal
Next
From: fabrizio.ermini@sysdat.it
Date:
Subject: Re: Re: PostreSQL SQL for MySQL SQL