On Jun 13, 2008, at 9:24 AM, Tom Lane wrote:
You'd do it while Binding a FETCH command.

Indeed, that is true. It seems quite unfortunate that drivers
have to jump through such hoops to provide a convenient
programmer's interface to held and/or scrollable cursors; bearing in
mind all that has been discussed about the--well, *my*--desire of
equivalent capabilities wrt the usual protocol level Prepare,
Describe, Bind, and Execute sequence.

Well, perhaps it is better to say that it is *ideal* to be able to
merely use the protocol mechanisms to achieve the desired
effect, rather than using them to use the SQL command yielding
the same or similar(Binding FETCH for different formats) effect. =\

[Obviously, I was looking to propose... ;]

My thoughts for creating a HOLD and/or SCROLL cursor on Bind would be
to add YA GUC stating the cursor options for Bind cursors. Something
along the lines of "default_bind_options=HOLD,SCROLL". Of
course the actual default would be an empty string so as to preserve the
existing functionality by default. I imagine there's a big fat "No"
waiting for me for at least the following reasons[in no particular order]:

1. It's already possible to achieve the desired result and the proposed feature
   is, of course, not going to work with past versions.
     [Just put in the extra work to support past versions of PG.]
2. I'm the only one asking/looking for it. (I'm so lonely ;)

It is, of course, ideal to be able to state these options in the Bind message, but I don't see how that would be a possibility without a new protocol version or doing something dangerous like embedding the options in the cursor's name.
"ain't happenin'".

And, yeah, despite the first reason, I think I would prefer to use a new GUC.
Certainly, with some bitterness. =(


In any case, thanks for the discussion, Tom.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to