Re: prepared statement: are they pre-compiled? - Mailing list pgsql-jdbc

From Heikki Linnakangas
Subject Re: prepared statement: are they pre-compiled?
Date
Msg-id 468CE300.3030405@enterprisedb.com
Whole thread Raw
In response to prepared statement: are they pre-compiled?  (Flipper <flipper@gammadue.com>)
List pgsql-jdbc
(please keep the list cc'd so that others can answer and benefit from
the discussions as well)

Flipper wrote:
> thank you for the quick reply. May I ask something more in order to understand
> if I'm right? When you use a Statement you should use  a simple query
> protocol (i.e., without a bind) but from the driver code I see that the
> sequence of messages is always the same, that is parse, bind, execute....
> I thought the simple query protocol does not include the parse+bind steps,
> since they should be in the extended query protocol.....am I wrong?

I think we use the extended query protocol for all queries, including
those issued from a Statement. That means we still send a Bind message,
there just isn't any parameter values in it. Note that we don't wait for
a response after each message, so that doesn't cause extra round trips
to the server.

--
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com

pgsql-jdbc by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: prepared statement: are they pre-compiled?
Next
From: Alessandro Di Bella
Date:
Subject: Bug in org.postgresql.jdbc2.AbstractJdbc2Array