Re: prepared statement "cu1" already exists (but it does not) - Mailing list pgsql-general

From Tom Lane
Subject Re: prepared statement "cu1" already exists (but it does not)
Date
Msg-id 3751333.1712680610@sss.pgh.pa.us
Whole thread Raw
In response to Re: prepared statement "cu1" already exists (but it does not)  (Sebastien Flaesch <sebastien.flaesch@4js.com>)
Responses Re: prepared statement "cu1" already exists (but it does not)
List pgsql-general
Sebastien Flaesch <sebastien.flaesch@4js.com> writes:
>>> Is it an issue if I use the same name for a prepared statement and the server cursor? I mean:

>> From memory, I think those share the same "portal" namespace.

> Can you please elaborate?

> Is it supported to do:
>    PQprepare(pgConn, "cu1", "declare cu1 cursor for ... ", ... )
>    PQexecPrepared(pgConn, "cu1", ... )
> ?

> So far this has always worked.

Ah, sorry, what I should have said is that the SQL PREPARE command
works with the same namespace as PQprepare (which is a thin wrapper
over the wire-protocol Parse command).  There is a different namespace
for cursors.  Cursors do share that namespace with the wire-protocol
"portal" concept, but libpq doesn't directly expose portals.

            regards, tom lane



pgsql-general by date:

Previous
From: yudhi s
Date:
Subject: Re: Moving delta data faster
Next
From: Thiemo Kellner
Date:
Subject: Re: [Code: 0, SQL State: 0A000] when "typing" from pg_catalog