Re: For cursors, there is FETCH and MOVE, why no TELL?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Marc Balmer <marc(at)msys(dot)ch>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: For cursors, there is FETCH and MOVE, why no TELL?
Date: 2015-02-10 15:25:57
Message-ID: CAFj8pRBZC+bgETnm7QjPDdQinbmcnmBwp+Wq2K389dx3RCiWzg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2015-02-10 16:21 GMT+01:00 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:

> Marc Balmer <marc(at)msys(dot)ch> writes:
> > That is simple indeed. I tend to think, however, that it would be
> > cleaner to return the position as a proper result from a functionn
> > instead of using a "side effect" from a FETCH/MOVE command.
>
> Yeah. For one thing, a command tag wouldn't help you at all if you
> wanted to know the current cursor position inside a plpgsql function.
>

It can solved via GET DIAGNOSTICS statement

>
> There are also backwards-compatibility reasons to be nervous about
> changing the long-standing command tag values for these commands.
>

yes, this is serious risk - and this is too high cost for relative less
used feature.

Regards

Pavel

> An issue that would have to be addressed is what the function ought
> to do if posOverflow is set, which is entirely feasible on Windows
> (or anyplace else where "long" is only 32 bits). Maybe we should
> redeclare portalPos as int64 and get rid of the posOverflow logic.
>
> regards, tom lane
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-02-10 15:29:24 Re: enabling nestedloop and disabling hashjon
Previous Message Tom Lane 2015-02-10 15:21:53 Re: For cursors, there is FETCH and MOVE, why no TELL?