Re: actualised forgotten Magnus's patch for plpgsql MOVE statement

Lists: pgsql-patches
From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: pgsql-patches(at)postgresql(dot)org
Cc: bruce(at)momjian(dot)us, tgl(at)sss(dot)pgh(dot)pa(dot)us, magnus(at)hagander(dot)net
Subject: actualised forgotten Magnus's patch for plpgsql MOVE statement
Date: 2007-04-20 07:46:28
Message-ID: BAY20-F19F23079E92158A1B91911F9560@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Hello

I refreshed Magnus's patch
http://archives.postgresql.org/pgsql-patches/2007-02/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 Content-Type Size
movestatement.diff text/x-patch 11.6 KB

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us, magnus(at)hagander(dot)net
Subject: Re: actualised forgotten Magnus's patch for plpgsql MOVE statement
Date: 2007-04-27 02:45:55
Message-ID: 200704270245.l3R2jtP04482@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


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-patches/2007-02/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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

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


From: Neil Conway <neilc(at)samurai(dot)com>
To: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org, bruce(at)momjian(dot)us, tgl(at)sss(dot)pgh(dot)pa(dot)us, magnus(at)hagander(dot)net
Subject: Re: actualised forgotten Magnus's patch for plpgsql MOVE statement
Date: 2007-04-29 01:27:32
Message-ID: 1177810052.6440.196.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

On Fri, 2007-04-20 at 09:46 +0200, Pavel Stehule wrote:
> I refreshed Magnus's patch
> http://archives.postgresql.org/pgsql-patches/2007-02/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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>, pgsql-patches(at)postgresql(dot)org, bruce(at)momjian(dot)us, magnus(at)hagander(dot)net
Subject: Re: actualised forgotten Magnus's patch for plpgsql MOVE statement
Date: 2007-04-29 03:37:41
Message-ID: 17697.1177817861@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)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


From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us, neilc(at)samurai(dot)com
Cc: pgsql-patches(at)postgresql(dot)org, bruce(at)momjian(dot)us, magnus(at)hagander(dot)net
Subject: Re: actualised forgotten Magnus's patch for plpgsql MOVE statement
Date: 2007-04-29 05:40:35
Message-ID: BAY114-F379239811AE131D4B5285F94D0@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


>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/


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, neilc(at)samurai(dot)com, pgsql-patches(at)postgresql(dot)org, magnus(at)hagander(dot)net
Subject: Re: actualised forgotten Magnus's patch for plpgsql MOVE statement
Date: 2007-05-16 03:20:25
Message-ID: 200705160320.l4G3KPD18175@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

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


From: "Pavel Stehule" <pavel(dot)stehule(at)gmail(dot)com>
To: "Bruce Momjian" <bruce(at)momjian(dot)us>
Cc: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>, tgl(at)sss(dot)pgh(dot)pa(dot)us, neilc(at)samurai(dot)com, pgsql-patches(at)postgresql(dot)org, magnus(at)hagander(dot)net
Subject: Re: actualised forgotten Magnus's patch for plpgsql MOVE statement
Date: 2007-05-16 14:14:14
Message-ID: 162867790705160714h2a05646cx70b807aea280844e@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

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

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

Regards
Pavel Stehule


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, neilc(at)samurai(dot)com, pgsql-patches(at)postgresql(dot)org, magnus(at)hagander(dot)net
Subject: Re: actualised forgotten Magnus's patch for plpgsql MOVE statement
Date: 2007-09-12 21:41:14
Message-ID: 200709122141.l8CLfEs18771@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://www.enterprisedb.com

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


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>
Cc: tgl(at)sss(dot)pgh(dot)pa(dot)us, neilc(at)samurai(dot)com, pgsql-patches(at)postgresql(dot)org, magnus(at)hagander(dot)net
Subject: Re: actualised forgotten Magnus's patch for plpgsql MOVE statement
Date: 2008-03-11 17:21:14
Message-ID: 200803111721.m2BHLEc09734@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


Added to TODO for pl/pgsql:

o Review handling of MOVE and FETCH

http://archives.postgresql.org/pgsql-patches/2007-04/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(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://postgres.enterprisedb.com

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