proposal - new SPI cursor function

Started by Pavel Stehuleabout 19 years ago9 messages
#1Pavel Stehule
pavel.stehule@hotmail.com

Hello,

I am working on support scrollable cursors in plpgpsm. Scrollable cursors
are in ToDo for plpgsql too. I need new function
SPI_cursor_fetch_with_direction(Portal portal, int direction, long count)
where is possible set direction of fetch statement.

any comments?

Regards

Pavel Stehule

_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci.
http://messenger.msn.cz/

#2Simon Riggs
simon@2ndquadrant.com
In reply to: Pavel Stehule (#1)
Re: proposal - new SPI cursor function

On Wed, 2007-01-03 at 18:30 +0100, Pavel Stehule wrote:

I am working on support scrollable cursors in plpgpsm. Scrollable cursors
are in ToDo for plpgsql too. I need new function
SPI_cursor_fetch_with_direction(Portal portal, int direction, long count)
where is possible set direction of fetch statement.

Sounds good.

Please ensure the default for PL/pgSQL remains as non-scrollable. That
may or may not be the same for plpgpsm.

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

#3Pavel Stehule
pavel.stehule@hotmail.com
In reply to: Simon Riggs (#2)
Re: proposal - new SPI cursor function

I am working on support scrollable cursors in plpgpsm. Scrollable

cursors

are in ToDo for plpgsql too. I need new function
SPI_cursor_fetch_with_direction(Portal portal, int direction, long

count)

where is possible set direction of fetch statement.

Sounds good.

Please ensure the default for PL/pgSQL remains as non-scrollable. That
may or may not be the same for plpgpsm.

Default plpgpsm cursors are non scrollable too. But I have to do two
patches. Syntax of declare section is total different. Between SQL/PSM and
plpgsql is only one big difference (in default values). SQL/PSM procedures
are flagged SECURITY DEFINER and plpgsql run wit default SECURITY CALLER.

Pavel

_________________________________________________________________
Chcete sdilet sve obrazky a hudbu s prateli? http://messenger.msn.cz/

#4David Fetter
david@fetter.org
In reply to: Pavel Stehule (#1)
Re: proposal - new SPI cursor function

On Wed, Jan 03, 2007 at 06:30:48PM +0100, Pavel Stehule wrote:

Hello,

I am working on support scrollable cursors in plpgpsm. Scrollable cursors
are in ToDo for plpgsql too. I need new function
SPI_cursor_fetch_with_direction(Portal portal, int direction, long count)

Is "int" a reasonable domain for directions? I'd think there would be
at most values.

Cheers,
D

where is possible set direction of fetch statement.

any comments?

Regards

Pavel Stehule

_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci.
http://messenger.msn.cz/

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

#5David Fetter
david@fetter.org
In reply to: David Fetter (#4)
Re: proposal - new SPI cursor function

On Wed, Jan 03, 2007 at 12:36:27PM -0800, David Fetter wrote:

On Wed, Jan 03, 2007 at 06:30:48PM +0100, Pavel Stehule wrote:

Hello,

I am working on support scrollable cursors in plpgpsm. Scrollable cursors
are in ToDo for plpgsql too. I need new function
SPI_cursor_fetch_with_direction(Portal portal, int direction, long count)

Is "int" a reasonable domain for directions? I'd think there would be
at most values.

Er, "at most two."

Cheers,
D

Cheers,
D

where is possible set direction of fetch statement.

any comments?

Regards

Pavel Stehule

_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci.
http://messenger.msn.cz/

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

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

--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

#6Pavel Stehule
pavel.stehule@hotmail.com
In reply to: David Fetter (#5)
Re: proposal - new SPI cursor function

i> >

Is "int" a reasonable domain for directions? I'd think there would be
at most values.

Er, "at most two."

enum is better, true

tree fields: FORWARD, BACKWARD, ABSOLUTE

Cheers,
D

Cheers,
D

where is possible set direction of fetch statement.

any comments?

Regards

Pavel Stehule

_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci.
http://messenger.msn.cz/

---------------------------(end of

broadcast)---------------------------

TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that

your

message can get through to the mailing list cleanly

--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

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

--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!

_________________________________________________________________
Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com.
http://www.msn.cz/

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Pavel Stehule (#1)
Re: proposal - new SPI cursor function

"Pavel Stehule" <pavel.stehule@hotmail.com> writes:

I need new function
SPI_cursor_fetch_with_direction(Portal portal, int direction, long count)
where is possible set direction of fetch statement.

Huh? SPI_cursor_fetch already lets you specify forward or backward.

regards, tom lane

#8Pavel Stehule
pavel.stehule@hotmail.com
In reply to: Tom Lane (#7)
Re: proposal - new SPI cursor function

"Pavel Stehule" <pavel.stehule@hotmail.com> writes:

I need new function
SPI_cursor_fetch_with_direction(Portal portal, int direction, long

count)

where is possible set direction of fetch statement.

Huh? SPI_cursor_fetch already lets you specify forward or backward.

regards, tom lane

It doesn't allow FETCH_ABSOLUTE

Regards
Pavel Stehule

_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci.
http://messenger.msn.cz/

#9Zeugswetter Andreas ADI SD
ZeugswetterA@spardat.at
In reply to: David Fetter (#5)
Re: proposal - new SPI cursor function

I am working on support scrollable cursors in plpgpsm. Scrollable

cursors

are in ToDo for plpgsql too. I need new function
SPI_cursor_fetch_with_direction(Portal portal, int direction, long

count)

Is "int" a reasonable domain for directions? I'd think there would

be

at most values.

enum is better, true

I don't think we want an enum here (maybe short).

tree fields: FORWARD, BACKWARD, ABSOLUTE

I think for fetch absolute you are missing an offset argument.

Andreas