Saturday, August 9, 2008

[HACKERS] which statements need bind/describe messages?

My client library sends Parse/Bind/Describe/Execute/Sync for each query,
unless it's using a previously-prepared statement, in which case it can
omit the Parse message.

For which statements can I also avoid sending Bind and Describe?

As far as I can tell, I can just send Parse/Execute/Sync for any utility
statements (i.e. those that are handled by ProcessUtility()) that do not
UtilityReturnsTuples(). Furthermore, I can omit Describe for ordinary
(i.e. without "returning") INSERT and DELETE and UPDATE. Right?

I could also omit Bind for any queries that do not have bind parameters,
except that I always want binary-format results; so I suppose I always
have to send Bind for non-utility statements.

Comments appreciated.

-- ams

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

No comments: