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

2008-03-11 Thread Bruce Momjian

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  <[EMAIL PROTECTED]>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


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

2007-09-12 Thread Bruce Momjian

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  <[EMAIL PROTECTED]>  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


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

2007-05-16 Thread Pavel Stehule


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 [EMAIL PROTECTED] so that your
  message can get through to the mailing list cleanly


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

2007-05-15 Thread Bruce Momjian
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  <[EMAIL PROTECTED]>  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


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

2007-04-28 Thread Pavel Stehule



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


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

2007-04-28 Thread Tom Lane
Neil Conway <[EMAIL PROTECTED]> 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


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

2007-04-28 Thread Neil Conway
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



---(end of broadcast)---
TIP 1: if posting/reading through Usenet, please send an appropriate
   subscribe-nomail command to [EMAIL PROTECTED] so that your
   message can get through to the mailing list cleanly