Re: proposal - new SPI cursor function

Lists: pgsql-hackers
From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: proposal - new SPI cursor function
Date: 2007-01-03 17:30:48
Message-ID: BAY114-F784DCAE0D3FF4B7B04306F9B90@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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/


From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal - new SPI cursor function
Date: 2007-01-03 18:12:59
Message-ID: 1167847980.3903.567.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: simon(at)2ndquadrant(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal - new SPI cursor function
Date: 2007-01-03 19:39:33
Message-ID: BAY20-F25C96ABC0023BBC63A2472F9B90@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: David Fetter <david(at)fetter(dot)org>
To: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal - new SPI cursor function
Date: 2007-01-03 20:36:27
Message-ID: 20070103203627.GE28334@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

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

Remember to vote!


From: David Fetter <david(at)fetter(dot)org>
To: Pavel Stehule <pavel(dot)stehule(at)hotmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal - new SPI cursor function
Date: 2007-01-03 20:53:07
Message-ID: 20070103205307.GF28334@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)postgresql(dot)org so that your
> > message can get through to the mailing list cleanly
>
> --
> David Fetter <david(at)fetter(dot)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(at)fetter(dot)org> http://fetter.org/
phone: +1 415 235 3778 AIM: dfetter666
Skype: davidfetter

Remember to vote!


From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: david(at)fetter(dot)org
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal - new SPI cursor function
Date: 2007-01-03 22:03:25
Message-ID: BAY20-F15811BD4ABD01AC4938A3F9B90@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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(at)postgresql(dot)org so that
>your
> > > message can get through to the mailing list cleanly
> >
> > --
> > David Fetter <david(at)fetter(dot)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(at)fetter(dot)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/


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal - new SPI cursor function
Date: 2007-01-03 23:05:40
Message-ID: 6897.1167865540@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)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


From: "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
To: tgl(at)sss(dot)pgh(dot)pa(dot)us
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: proposal - new SPI cursor function
Date: 2007-01-04 05:04:37
Message-ID: BAY20-F141856F70A06D59116AB91F9B80@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


>
>"Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)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/


From: "Zeugswetter Andreas ADI SD" <ZeugswetterA(at)spardat(dot)at>
To: "David Fetter" <david(at)fetter(dot)org>, "Pavel Stehule" <pavel(dot)stehule(at)hotmail(dot)com>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal - new SPI cursor function
Date: 2007-01-05 08:58:32
Message-ID: E1539E0ED7043848906A8FF995BDA57901A35854@m0143.s-mxs.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


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