Unix Technical Forum

actualised forgotten Magnus's patch for plpgsql MOVE statement

This is a discussion on actualised forgotten Magnus's patch for plpgsql MOVE statement within the Pgsql Patches forums, part of the PostgreSQL category; --> Hello I refreshed Magnus's patch http://archives.postgresql.org/pgsql...2/msg00275.php from februar. Regards Pavel Stehule p.s. scrollable cursors in plpgsql need little work ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql Patches

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-18-2008, 10:58 AM
Pavel Stehule
 
Posts: n/a
Default actualised forgotten Magnus's patch for plpgsql MOVE statement

Hello

I refreshed Magnus's patch
http://archives.postgresql.org/pgsql...2/msg00275.php from
februar.

Regards

Pavel Stehule

p.s. scrollable cursors in plpgsql need little work still. I forgot for
nonstandard (postgresql extension) direction forward all, forward n,
backward n. Forward all propably hasn't sense.

__________________________________________________ _______________
Najdete si svou lasku a nove pratele na Match.com. http://www.msn.cz/


---------------------------(end of broadcast)---------------------------
TIP 7: You can help support the PostgreSQL project by donating at

http://www.postgresql.org/about/donate

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-18-2008, 10:59 AM
Bruce Momjian
 
Posts: n/a
Default Re: actualised forgotten Magnus's patch for plpgsql MOVEstatement


Your patch has been added to the PostgreSQL unapplied patches list at:

http://momjian.postgresql.org/cgi-bin/pgpatches

It will be applied as soon as one of the PostgreSQL committers reviews
and approves it.

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


Pavel Stehule wrote:
> Hello
>
> I refreshed Magnus's patch
> http://archives.postgresql.org/pgsql...2/msg00275.php from
> februar.
>
> Regards
>
> Pavel Stehule
>
> p.s. scrollable cursors in plpgsql need little work still. I forgot for
> nonstandard (postgresql extension) direction forward all, forward n,
> backward n. Forward all propably hasn't sense.
>
> __________________________________________________ _______________
> Najdete si svou lasku a nove pratele na Match.com. http://www.msn.cz/


[ Attachment, skipping... ]

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

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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-18-2008, 11:00 AM
Neil Conway
 
Posts: n/a
Default Re: actualised forgotten Magnus's patch for plpgsql MOVEstatement

On Fri, 2007-04-20 at 09:46 +0200, Pavel Stehule wrote:
> I refreshed Magnus's patch
> http://archives.postgresql.org/pgsql...2/msg00275.php from
> februar.


Applied, thanks.

BTW, I notice that the documentation for PL/PgSQL's FETCH command states
that only the direction variants that fetch a *single* row are allowed.
This is not actually the case: FETCH RELATIVE 2 FROM c INTO v results in
assigning the first row from "c" into "v", and then discarding the
second row. Is this the best behavior? At the least, we should describe
it in the documentation.

> p.s. scrollable cursors in plpgsql need little work still. I forgot for
> nonstandard (postgresql extension) direction forward all, forward n,
> backward n. Forward all propably hasn't sense.


Yes, these are certainly needed for MOVE, and we may as well allow them
for FETCH as well.

-Neil



---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-18-2008, 11:00 AM
Tom Lane
 
Posts: n/a
Default Re: actualised forgotten Magnus's patch for plpgsql MOVE statement

Neil Conway <neilc@samurai.com> writes:
> BTW, I notice that the documentation for PL/PgSQL's FETCH command states
> that only the direction variants that fetch a *single* row are allowed.
> This is not actually the case: FETCH RELATIVE 2 FROM c INTO v results in
> assigning the first row from "c" into "v", and then discarding the
> second row.


What? That's not what it did when I was reviewing the code. It should
skip one row and assign the second one to v.

>> p.s. scrollable cursors in plpgsql need little work still. I forgot for
>> nonstandard (postgresql extension) direction forward all, forward n,
>> backward n. Forward all propably hasn't sense.


> Yes, these are certainly needed for MOVE, and we may as well allow them
> for FETCH as well.


No, because these variants specify returning multiple rows, which is
exactly what plpgsql doesn't support. FETCH FORWARD 2 and FETCH
RELATIVE 2 are *entirely* different animals, and we shouldn't confuse
them. If we do, we'll regret it someday when we'd like to actually
offer that functionality somehow in plpgsql.

I would argue that we should likewise not allow them in plpgsql's MOVE,
although this is more of a judgment call than is the case for FETCH.
I just don't think it's a good idea to provide two redundant ways to do
the same thing, when we might want to make one of the ways mean
something else later. There's no upside and there might be a downside.

regards, tom lane

---------------------------(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
  #5 (permalink)  
Old 04-18-2008, 11:00 AM
Pavel Stehule
 
Posts: n/a
Default Re: actualised forgotten Magnus's patch for plpgsql MOVE statement


>I would argue that we should likewise not allow them in plpgsql's MOVE,
>although this is more of a judgment call than is the case for FETCH.
>I just don't think it's a good idea to provide two redundant ways to do
>the same thing, when we might want to make one of the ways mean
>something else later. There's no upside and there might be a downside.
>


It's question. There are lot of links to FETCH in doc, and we support from
FETCH direction only subset. It needs at least notice in documentation. When
I testeid MOVE I found an form
MOVE FORWARD 10 ... more natural than MOVE RELATIVE 10 and if we support
MOVE FORWARD ... then is logic support MOVE FORWARD n ,

else FORWARD, BACKWARD are nonstandard and MOVE statement too.

Regards
Pavel Stehule

__________________________________________________ _______________
Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com.
http://www.msn.cz/


---------------------------(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
  #6 (permalink)  
Old 04-18-2008, 11:04 AM
Bruce Momjian
 
Posts: n/a
Default Re: actualised forgotten Magnus's patch for plpgsqlMOVE statement

Pavel Stehule wrote:
>
> >I would argue that we should likewise not allow them in plpgsql's MOVE,
> >although this is more of a judgment call than is the case for FETCH.
> >I just don't think it's a good idea to provide two redundant ways to do
> >the same thing, when we might want to make one of the ways mean
> >something else later. There's no upside and there might be a downside.
> >

>
> It's question. There are lot of links to FETCH in doc, and we support from
> FETCH direction only subset. It needs at least notice in documentation. When
> I testeid MOVE I found an form
> MOVE FORWARD 10 ... more natural than MOVE RELATIVE 10 and if we support
> MOVE FORWARD ... then is logic support MOVE FORWARD n ,
>
> else FORWARD, BACKWARD are nonstandard and MOVE statement too.


Do we have a patch to make this consistent?

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

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

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-18-2008, 11:04 AM
Pavel Stehule
 
Posts: n/a
Default Re: actualised forgotten Magnus's patch for plpgsql MOVE statement

>
> Do we have a patch to make this consistent?
>


no, not yet. It's topic for discussion and ToDo

Regards
Pavel Stehule

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-18-2008, 11:37 AM
Bruce Momjian
 
Posts: n/a
Default Re: actualised forgotten Magnus's patch for plpgsqlMOVE statement


This has been saved for the 8.4 release:

http://momjian.postgresql.org/cgi-bin/pgpatches_hold

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

Pavel Stehule wrote:
>
> >I would argue that we should likewise not allow them in plpgsql's MOVE,
> >although this is more of a judgment call than is the case for FETCH.
> >I just don't think it's a good idea to provide two redundant ways to do
> >the same thing, when we might want to make one of the ways mean
> >something else later. There's no upside and there might be a downside.
> >

>
> It's question. There are lot of links to FETCH in doc, and we support from
> FETCH direction only subset. It needs at least notice in documentation. When
> I testeid MOVE I found an form
> MOVE FORWARD 10 ... more natural than MOVE RELATIVE 10 and if we support
> MOVE FORWARD ... then is logic support MOVE FORWARD n ,
>
> else FORWARD, BACKWARD are nonstandard and MOVE statement too.
>
> Regards
> Pavel Stehule
>
> __________________________________________________ _______________
> Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com.
> http://www.msn.cz/
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings


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

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

---------------------------(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
  #9 (permalink)  
Old 04-19-2008, 07:26 AM
Bruce Momjian
 
Posts: n/a
Default Re: actualised forgotten Magnus's patch for plpgsqlMOVE statement


Added to TODO for pl/pgsql:

o Review handling of MOVE and FETCH

http://archives.postgresql.org/pgsql...4/msg00527.php


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

Pavel Stehule wrote:
>
> >I would argue that we should likewise not allow them in plpgsql's MOVE,
> >although this is more of a judgment call than is the case for FETCH.
> >I just don't think it's a good idea to provide two redundant ways to do
> >the same thing, when we might want to make one of the ways mean
> >something else later. There's no upside and there might be a downside.
> >

>
> It's question. There are lot of links to FETCH in doc, and we support from
> FETCH direction only subset. It needs at least notice in documentation. When
> I testeid MOVE I found an form
> MOVE FORWARD 10 ... more natural than MOVE RELATIVE 10 and if we support
> MOVE FORWARD ... then is logic support MOVE FORWARD n ,
>
> else FORWARD, BACKWARD are nonstandard and MOVE statement too.
>
> Regards
> Pavel Stehule
>
> __________________________________________________ _______________
> Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com.
> http://www.msn.cz/
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings


--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

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

--
Sent via pgsql-patches mailing list (pgsql-patches@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-patches

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 04:22 PM.


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