Re: How to create named portal except cursor? - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: How to create named portal except cursor?
Date
Msg-id CAKFQuwZTPm7t2nJhqBbdAq8QKMwV9g6EjRJBgpUWsYB+_4UKEw@mail.gmail.com
Whole thread Raw
In response to How to create named portal except cursor?  (Hubert Zhang <hzhang@pivotal.io>)
List pgsql-hackers
On Thu, Jul 18, 2019 at 8:58 PM Hubert Zhang <hzhang@pivotal.io> wrote:
Is there any way to create a named portal except cursor in PG?
I tried postgres-jdbc driver and use PrepareStatement. Backend could receive `bind` and `execute` message, but the portal name is still empty. How can I specify the portal name?

This seems like a question better posed to the JDBC list as opposed to -hackers.  The protocol can technically (from the description of parse+bind) handle what you describe but whether this specific client provides access to the capability is outside the scope of this list.  I will say that there doesn't seem to be a way in pure SQL to use a prepared statement and have it create a named portal (PREPARE not allowing DECLARE to be the underlying statement).

You may wish to describe what you are trying to do at a higher level.  If it is something like the above you might find a solution to your unspecified problem by using cursors within a pl/pgsql function.

David J.

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Intermittent pg_ctl failures on Windows
Next
From: Amit Khandekar
Date:
Subject: Re: Minimal logical decoding on standbys