Обсуждение: Re: Bug in move 0
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> I just sent off an email stating that MOVE 0 goes to the end, and that
> the FETCH manual page says:
> Postgres does not currently support this notion; in
> fact the value zero is reserved to indicate that
> all rows should be retrieved and is equivalent to
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> specifying the ALL keyword. If the RELATIVE key-
> word has been used, the Postgres assumes that the
> user intended SQL92 behavior and returns this error
> message.
> So it seems we are OK.
We may have documented the behavior, but that doesn't make it right ;-)
If someone were to submit a patch to change MOVE 0 into a no-op
(without breaking MOVE ALL of course), I'd vote to apply it.
regards, tom lane
> Bruce Momjian <pgman@candle.pha.pa.us> writes: > > I just sent off an email stating that MOVE 0 goes to the end, and that > > the FETCH manual page says: > > > Postgres does not currently support this notion; in > > fact the value zero is reserved to indicate that > > all rows should be retrieved and is equivalent to > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > specifying the ALL keyword. If the RELATIVE key- > > word has been used, the Postgres assumes that the > > user intended SQL92 behavior and returns this error > > message. > > > So it seems we are OK. > > We may have documented the behavior, but that doesn't make it right ;-) > If someone were to submit a patch to change MOVE 0 into a no-op > (without breaking MOVE ALL of course), I'd vote to apply it. If we do that, how does one move to the end of a cursor? -- Bruce Momjian | http://www.op.net/~candle pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> We may have documented the behavior, but that doesn't make it right ;-)
>> If someone were to submit a patch to change MOVE 0 into a no-op
>> (without breaking MOVE ALL of course), I'd vote to apply it.
> If we do that, how does one move to the end of a cursor?
MOVE ALL.
The problem right now is just that MOVE ALL is internally represented
as MOVE 0 ... there needs to be a different representation for it.
regards, tom lane
> Bruce Momjian <pgman@candle.pha.pa.us> writes:
> >> We may have documented the behavior, but that doesn't make it right ;-)
> >> If someone were to submit a patch to change MOVE 0 into a no-op
> >> (without breaking MOVE ALL of course), I'd vote to apply it.
>
> > If we do that, how does one move to the end of a cursor?
>
> MOVE ALL.
>
> The problem right now is just that MOVE ALL is internally represented
> as MOVE 0 ... there needs to be a different representation for it.
>
> regards, tom lane
>
Added to TODO:
* MOVE 0 should not move to end of cursor
--
Bruce Momjian | http://www.op.net/~candle
pgman@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026