Move cursor support for pl/pgsql

Started by Magnus Haganderover 19 years ago3 messagespatches
Jump to latest
#1Magnus Hagander
magnus@hagander.net

Hi!

I took a stab at implementing MOVE support for cursors in PL/pgsql,
because I wanted it for a project. Attached patch *seems* to work. But..
Given that this is my first venture into touching bison/flex files, I
may be completely off-target in how it's done.

Could somebody take a look at it and comment on if I'm completelyi off
or only slightly off?
(And if there are good arguments not to include MOVE support at all in
pl/pgsql, I'd still be interested in comments on the rest of it, in
order to learn..)

Thanks!

//Magnus

Attachments:

plpgsql_move.patchtext/plain; charset=us-asciiDownload+222-13
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Magnus Hagander (#1)
Re: Move cursor support for pl/pgsql

Magnus Hagander <magnus@hagander.net> writes:

I took a stab at implementing MOVE support for cursors in PL/pgsql,
because I wanted it for a project. Attached patch *seems* to work. But..
Given that this is my first venture into touching bison/flex files, I
may be completely off-target in how it's done.

I disapprove of hard-wiring the fetch count as an integer constant;
there's no good reason not to treat it as an expression. So you should
drop the T_NUMBER thing.

regards, tom lane

#3Magnus Hagander
magnus@hagander.net
In reply to: Tom Lane (#2)
Re: Move cursor support for pl/pgsql

Tom Lane wrote:

Magnus Hagander <magnus@hagander.net> writes:

I took a stab at implementing MOVE support for cursors in PL/pgsql,
because I wanted it for a project. Attached patch *seems* to work. But..
Given that this is my first venture into touching bison/flex files, I
may be completely off-target in how it's done.

I disapprove of hard-wiring the fetch count as an integer constant;
there's no good reason not to treat it as an expression. So you should
drop the T_NUMBER thing.

Will do, thanks for commenting. I'm also going to merge it with Pavels
work that I had completely missed earlier.

//Magnus