Re: scrollable cursor sup. for SPI - Mailing list pgsql-patches

From Pavel Stehule
Subject Re: scrollable cursor sup. for SPI
Date
Msg-id BAY20-F805F83DC8E870FED70C23F9B40@phx.gbl
Whole thread Raw
In response to Re: scrollable cursor sup. for SPI  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: scrollable cursor sup. for SPI
List pgsql-patches
>Neil Conway <neilc@samurai.com> writes:
> > BTW, how do people feel about the function names:
>
> >     SPI_cursor_open_with_options
> >     SPI_scroll_cursor_fetch
> >     SPI_scroll_cursor_move
>
>I dislike the SPI_cursor_open_with_options API on the grounds that it
>lets people break things (CURSOR_OPT_HOLD for instance isn't likely
>to do anything good) and it doesn't actually provide any functionality
>that wasn't there before (the existing code already sets OPT_SCROLL
>if possible).  I'd suggest losing that one entirely and just adding
>the FetchDirection-as-substitute-for-"forward" entry points.
>

First variant of this "open" function controlls only sroll option. But there
are other option which we have to controll in futere like INSENSITIVE,
SENSITIVE, FOR UPDATE and it's reason for _with_options.

if I comprehended it well CURSOR_OPT_SCROLL is set only when SCROLL is cheap
(not when is possible). It's true?

      /*
         * Set up options for portal.
         *
         * If the user didn't specify a SCROLL type, allow or disallow
scrolling
         * based on whether it would require any additional runtime overhead
to do
         * so.
         */
        portal->cursorOptions = stmt->options;
        if (!(portal->cursorOptions & (CURSOR_OPT_SCROLL |
CURSOR_OPT_NO_SCROLL)))
        {
                if (ExecSupportsBackwardScan(plan))
                        portal->cursorOptions |= CURSOR_OPT_SCROLL;
                else
                        portal->cursorOptions |= CURSOR_OPT_NO_SCROLL;

_________________________________________________________________
Najdete si svou lasku a nove pratele na Match.com. http://www.msn.cz/


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] Autovacuum improvements
Next
From: Tom Lane
Date:
Subject: Re: scrollable cursor sup. for SPI