Re: Options for protocol level cursors

From: James William Pye <pgsql(at)jwp(dot)name>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Options for protocol level cursors
Date: 2008-06-13 21:43:28
Message-ID: 4A5048F0-AAE5-418E-8C84-462421A8CF14@jwp.name
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-06-13 21:50:38 Re: TODO Item: Allow pg_hba.conf to specify host names along with IP addresses
Previous Message Alvaro Herrera 2008-06-13 20:14:13 Re: TODO Item: Allow pg_hba.conf to specify host names along with IP addresses