Unix Technical Forum

BUG #2494: SCROLL CURSOR does not worl

This is a discussion on BUG #2494: SCROLL CURSOR does not worl within the pgsql Bugs forums, part of the PostgreSQL category; --> The following bug has been logged online: Bug reference: 2494 Logged by: Michal Szymanski Email address: biuro@globeinphotos.com PostgreSQL version: ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Bugs

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 11:04 AM
Michal Szymanski
 
Posts: n/a
Default BUG #2494: SCROLL CURSOR does not worl


The following bug has been logged online:

Bug reference: 2494
Logged by: Michal Szymanski
Email address: biuro@globeinphotos.com
PostgreSQL version: 8.1
Operating system: Windows
Description: SCROLL CURSOR does not worl
Details:

Function with scroll cursor cannot be compiled.
ERROR: syntax error at or near "CURSOR"
CONTEXT: invalid type name "SCROLL CURSOR FOR SELECT * FROM freeconet.alias
WHERE mask >"
compile of PL/pgSQL function "dummy" near line 3

Function that I want compile.
CREATE OR REPLACE FUNCTION freeconet.dummy (
) RETURNS INT8 AS $$
DECLARE
rowvar freeconet.ALIAS%ROWTYPE;
DECLARE curs1 SCROLL CURSOR FOR SELECT * FROM freeconet.alias WHERE
mask>='+4850X' LIMIT 100 ;
BEGIN
BEGIN

OPEN curs1;
FETCH curs1 INTO rowvar;

EXCEPTION
WHEN OTHERS THEN
RAISE WARNING '.... Kod bledu = %', SQLSTATE;
RETURN -1; /* blad danych */
END;
RAISE WARNING ' mask=%',rowvar.mask;
RETURN 1;
END;
$$ LANGUAGE 'plpgsql' VOLATILE;

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 11:05 AM
Jim C. Nasby
 
Posts: n/a
Default Re: BUG #2494: SCROLL CURSOR does not worl

There's no such thing as a 'SCROLL CURSOR' in plpgsql:
http://www.postgresql.org/docs/8.1/i...l-cursors.html
I'm pretty sure that the default behavior would be scrollable.

We should probably add a TODO to bring the plpgsql cursor syntax inline
with what the backend supports.

On Fri, Jun 23, 2006 at 01:44:24PM +0000, Michal Szymanski wrote:
>
> The following bug has been logged online:
>
> Bug reference: 2494
> Logged by: Michal Szymanski
> Email address: biuro@globeinphotos.com
> PostgreSQL version: 8.1
> Operating system: Windows
> Description: SCROLL CURSOR does not worl
> Details:
>
> Function with scroll cursor cannot be compiled.
> ERROR: syntax error at or near "CURSOR"
> CONTEXT: invalid type name "SCROLL CURSOR FOR SELECT * FROM freeconet.alias
> WHERE mask >"
> compile of PL/pgSQL function "dummy" near line 3
>
> Function that I want compile.
> CREATE OR REPLACE FUNCTION freeconet.dummy (
> ) RETURNS INT8 AS $$
> DECLARE
> rowvar freeconet.ALIAS%ROWTYPE;
> DECLARE curs1 SCROLL CURSOR FOR SELECT * FROM freeconet.alias WHERE
> mask>='+4850X' LIMIT 100 ;
> BEGIN
> BEGIN
>
> OPEN curs1;
> FETCH curs1 INTO rowvar;
>
> EXCEPTION
> WHEN OTHERS THEN
> RAISE WARNING '.... Kod bledu = %', SQLSTATE;
> RETURN -1; /* blad danych */
> END;
> RAISE WARNING ' mask=%',rowvar.mask;
> RETURN 1;
> END;
> $$ LANGUAGE 'plpgsql' VOLATILE;
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>


--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 11:05 AM
Bruce Momjian
 
Posts: n/a
Default Re: BUG #2494: SCROLL CURSOR does not worl


Added to TODO:

> o Add support for WITH HOLD and SCROLL cursors
>
> PL/pgSQL cursors should support the same syntax as
> backend cursors.



---------------------------------------------------------------------------

Jim C. Nasby wrote:
> There's no such thing as a 'SCROLL CURSOR' in plpgsql:
> http://www.postgresql.org/docs/8.1/i...l-cursors.html
> I'm pretty sure that the default behavior would be scrollable.
>
> We should probably add a TODO to bring the plpgsql cursor syntax inline
> with what the backend supports.
>
> On Fri, Jun 23, 2006 at 01:44:24PM +0000, Michal Szymanski wrote:
> >
> > The following bug has been logged online:
> >
> > Bug reference: 2494
> > Logged by: Michal Szymanski
> > Email address: biuro@globeinphotos.com
> > PostgreSQL version: 8.1
> > Operating system: Windows
> > Description: SCROLL CURSOR does not worl
> > Details:
> >
> > Function with scroll cursor cannot be compiled.
> > ERROR: syntax error at or near "CURSOR"
> > CONTEXT: invalid type name "SCROLL CURSOR FOR SELECT * FROM freeconet.alias
> > WHERE mask >"
> > compile of PL/pgSQL function "dummy" near line 3
> >
> > Function that I want compile.
> > CREATE OR REPLACE FUNCTION freeconet.dummy (
> > ) RETURNS INT8 AS $$
> > DECLARE
> > rowvar freeconet.ALIAS%ROWTYPE;
> > DECLARE curs1 SCROLL CURSOR FOR SELECT * FROM freeconet.alias WHERE
> > mask>='+4850X' LIMIT 100 ;
> > BEGIN
> > BEGIN
> >
> > OPEN curs1;
> > FETCH curs1 INTO rowvar;
> >
> > EXCEPTION
> > WHEN OTHERS THEN
> > RAISE WARNING '.... Kod bledu = %', SQLSTATE;
> > RETURN -1; /* blad danych */
> > END;
> > RAISE WARNING ' mask=%',rowvar.mask;
> > RETURN 1;
> > END;
> > $$ LANGUAGE 'plpgsql' VOLATILE;
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 4: Have you searched our list archives?
> >
> > http://archives.postgresql.org
> >

>
> --
> Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
> Pervasive Software http://pervasive.com work: 512-231-6117
> vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461
>
> ---------------------------(end of broadcast)---------------------------
> TIP 9: In versions below 8.0, the planner will ignore your desire to
> choose an index scan if your joining column's datatypes do not
> match
>


--
Bruce Momjian bruce@momjian.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:19 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com