Re: Is it possible to create a cursor with hold using extended query protocol

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Dave Cramer <davecramer(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Is it possible to create a cursor with hold using extended query protocol
Date: 2024-07-10 15:04:15
Message-ID: CAKFQuwasYmECjG8ME__AQvP8S3vW37XAPigY817vwToOarWNQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wednesday, July 10, 2024, Dave Cramer <davecramer(at)gmail(dot)com> wrote:

> Greetings,
>
> There are suggestions that you can use extended query to fetch from a
> cursor, however I don't see how you can bind values to the cursor ?
>
> PostgreSQL: Documentation: 16: FETCH
> <https://www.postgresql.org/docs/16/sql-fetch.html>
>
> Is this possible?
>

Not that i can see. The declare’d query isn’t shown to accept $n bindings
rather it must be executable (select or values). Per the note on declare,
the bind phase of the fetch command under the extended protocol is used to
determine whether values retrieved are text or binary. Beyond that, the
bind is really just a formality of the protocol, the same as for executing
any other non-parameterized query that way.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2024-07-10 15:08:05 Re: Add a GUC check hook to ensure summarize_wal cannot be enabled when wal_level is minimal
Previous Message Antonin Houska 2024-07-10 15:00:13 Missed opportunity for bsearch() in TransactionIdIsCurrentTransactionId()?