Re: NOT EXIST for PREPARE - Mailing list pgsql-hackers

From Vladimir Sitnikov
Subject Re: NOT EXIST for PREPARE
Date
Msg-id CAB=Je-Es0uZtogqNBQHqsQ0OB_8A_1Lymvc7UgeUPxzzX-sYNQ@mail.gmail.com
Whole thread Raw
In response to Re: NOT EXIST for PREPARE  (Merlin Moncure <mmoncure@gmail.com>)
Responses Re: NOT EXIST for PREPARE
List pgsql-hackers
Merlin>No one is arguing that that you should send it any every time (at
least -- I hope not).

Well, what is your suggestion exactly?

pgjdbc is NOT using "prepare ..." sql command.
I'm inclined to suppose, it will not use "prepare..." even after your fix.

Merlin>Again, not in pooling scenarios
Merlin>The problems integrating server side
Merlin>prepared statements with pgbouncer are well known.

I'm afraid, they are not.

Your words are "This feature should be immediately be incorporated
by the JDBC driver" yet you have not raised that subject on pgsql-jdbc
mailing list/github issue. That is not very fair.

Let me just name an alternative, so you can see what "a step back" could be:
What if pg-bouncer generated _fake_ ParameterStatus(backend_id=...)
messages to pgjdbc?
Then pgjdbc can learn true backend session id and it can use proper
set of prepared statements. Basically, pgjdbc could have prepared statement
cache per backend_id.
Well, it is not a 100% solution, however it is yet another approach to
"pgbouncer" problem, and it will support all the PostgreSQL versions.

It fits into current frontend-backend protocol as all clients are supposed
to handle ParameterStatus messages, etc.

Vladimir



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Rationalizing code-sharing among src/bin/ directories
Next
From: Petr Jelinek
Date:
Subject: Re: multivariate statistics v14