pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: wieck@debis.com
To: ulu@bornova.ege.edu.tr
Cc: pgsql-sql@postgreSQL.org
Cc: maillist@candle.pha.pa.us
Subject: Re: [SQL] Declare Cursor...
Date: Mon, 8 Nov 1999 18:57:04 +0100 (MET)
Message-ID: <m11kt2O-0003kLC@orion.SAPserv.Hamburg.dsh.de> (raw)
In-Reply-To: <Pine.OSF.4.00.9911081725380.29768-100000@bornova.ege.edu.tr>

Baris ULU wrote:

>    I am trying to declare a cursor inside a plpgsql function in a
> begin end block as in the following:
> create function func_1(char, float8, int4, int4) returns int4 as '
>  declare
>    x alias for $1;
>    y alias for $2;
>    z alias for $3;
>    t alias for $4;
>    ...
>  begin work;
>   declare cursor_x cursor for select a, b, c, d from table_1 where a = x;
>   ...
>  end work;
>
>    when this function is compiled, it gives me the following error:
>         NOTICE: plpgsql: ERROR during compile of func_1 near line ...
>         ERROR: parse error at or near "CURSOR"
>
> If anyone can help me about my problem, I will be very happy...THANKS!

    Backend  functions  cannot use cursors. This is not supported
    by  the  underlying  mechanism  of  portals  and  the  server
    programming interface.

    Yes,  it's  a very bad limitation since the SPI tries to load
    the entire result set into memory, possibly blowing away  the
    backend  process.   I  don't know how and when we will tackle
    this, but it should go onto the TODO, Bruce.


Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me.                                  #
#========================================= wieck@debis.com (Jan Wieck) #





view thread (2+ messages)

Message-ID: <m11kt2O-0003kLC@orion.SAPserv.Hamburg.dsh.de>
Permalink:  ../m11kt2O-0003kLC@orion.SAPserv.Hamburg.dsh.de/
Also on:    postgresql.org/message-id/m11kt2O-0003kLC@orion.SAPserv.Hamburg.dsh.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: wieck@debis.com, ulu@bornova.ege.edu.tr, maillist@candle.pha.pa.us
  Subject: Re: [SQL] Declare Cursor...
  In-Reply-To: <m11kt2O-0003kLC@orion.SAPserv.Hamburg.dsh.de>
  References: <Pine.OSF.4.00.9911081725380.29768-100000@bornova.ege.edu.tr> <m11kt2O-0003kLC@orion.SAPserv.Hamburg.dsh.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox