Re: How to create named portal except cursor?

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Hubert Zhang <hzhang(at)pivotal(dot)io>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: How to create named portal except cursor?
Date: 2019-07-19 05:42:54
Message-ID: CAKFQuwZTPm7t2nJhqBbdAq8QKMwV9g6EjRJBgpUWsYB+_4UKEw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jul 18, 2019 at 8:58 PM Hubert Zhang <hzhang(at)pivotal(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Khandekar 2019-07-19 05:45:49 Re: Minimal logical decoding on standbys
Previous Message Michael Paquier 2019-07-19 05:23:36 Re: Intermittent pg_ctl failures on Windows