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

2015-02-10 Thread Pavel Stehule
2015-02-10 16:21 GMT+01:00 Tom Lane : > Marc Balmer 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 com

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

2015-02-10 Thread Tom Lane
Marc Balmer 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

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

2015-02-10 Thread Pavel Stehule
2015-02-10 14:32 GMT+01:00 Marc Balmer : > > > Am 10.02.15 um 09:06 schrieb Pavel Stehule: > > Hi > > > > > > the patch can be very simple: > > > > diff --git a/src/backend/commands/portalcmds.c > > b/src/backend/commands/portalcmds.c > > new file mode 100644 > > index 2794537..20b9206 > > *** a/s

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

2015-02-10 Thread Marc Balmer
Am 10.02.15 um 09:06 schrieb Pavel Stehule: > Hi > > > the patch can be very simple: > > diff --git a/src/backend/commands/portalcmds.c > b/src/backend/commands/portalcmds.c > new file mode 100644 > index 2794537..20b9206 > *** a/src/backend/commands/portalcmds.c > --- b/src/backend/commands/p

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

2015-02-10 Thread Pavel Stehule
Hi the patch can be very simple: diff --git a/src/backend/commands/portalcmds.c b/src/backend/commands/portalcmds.c new file mode 100644 index 2794537..20b9206 *** a/src/backend/commands/portalcmds.c --- b/src/backend/commands/portalcmds.c *** PerformPortalFetch(FetchStmt *stmt, ***

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

2015-02-09 Thread Marc Balmer
Am 09.02.15 um 13:13 schrieb Hakan Kocaman: > Hi, > > 2015-02-09 10:37 GMT+01:00 Marc Balmer mailto:m...@msys.ch>>: > > > (I use cursors to display large datasets in a page-wise way, where the > user can move per-page, or, when displaying a single record, per record. > When the us

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

2015-02-09 Thread Hakan Kocaman
Hi, 2015-02-09 10:37 GMT+01:00 Marc Balmer : > > (I use cursors to display large datasets in a page-wise way, where the > user can move per-page, or, when displaying a single record, per record. > When the user goes back from per-record view to page-view, I have to > restore the cursor to the po

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

2015-02-09 Thread Marc Balmer
Am 09.02.15 um 11:47 schrieb Marc Balmer: > > > Am 09.02.15 um 10:46 schrieb Heikki Linnakangas: >> [...] >> You could fairly easily write an extension to do that, btw. A C function >> could call GetPortalByName() and peek into the PortalData.portalPos field. >> > > Would > > PGresult *PQdes

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

2015-02-09 Thread Marc Balmer
Am 09.02.15 um 10:46 schrieb Heikki Linnakangas: > [...] > You could fairly easily write an extension to do that, btw. A C function > could call GetPortalByName() and peek into the PortalData.portalPos field. > Would PGresult *PQdescribePortal(PGconn *conn, const char *portalName); from libp

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

2015-02-09 Thread Pavel Stehule
2015-02-09 10:59 GMT+01:00 Marc Balmer : > > > > 2015-02-09 10:37 GMT+01:00 Marc Balmer m...@msys.ch>>: > > > > Currently there are FETCH and the (non standard) MOVE commands to > work > > on cursors. > > > > (I use cursors to display large datasets in a page-wise way, where > the > >

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

2015-02-09 Thread Marc Balmer
> > 2015-02-09 10:37 GMT+01:00 Marc Balmer mailto:m...@msys.ch>>: > > Currently there are FETCH and the (non standard) MOVE commands to work > on cursors. > > (I use cursors to display large datasets in a page-wise way, where the > user can move per-page, or, when displaying a si

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

2015-02-09 Thread Pavel Stehule
Hi 2015-02-09 10:37 GMT+01:00 Marc Balmer : > Currently there are FETCH and the (non standard) MOVE commands to work > on cursors. > > (I use cursors to display large datasets in a page-wise way, where the > user can move per-page, or, when displaying a single record, per record. > When the user

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

2015-02-09 Thread Heikki Linnakangas
On 02/09/2015 11:37 AM, Marc Balmer wrote: Currently there are FETCH and the (non standard) MOVE commands to work on cursors. (I use cursors to display large datasets in a page-wise way, where the user can move per-page, or, when displaying a single record, per record. When the user goes back

[HACKERS] For cursors, there is FETCH and MOVE, why no TELL?

2015-02-09 Thread Marc Balmer
Currently there are FETCH and the (non standard) MOVE commands to work on cursors. (I use cursors to display large datasets in a page-wise way, where the user can move per-page, or, when displaying a single record, per record. When the user goes back from per-record view to page-view, I have to r