Re: Proper query implementation for Postgresql driver - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proper query implementation for Postgresql driver
Date
Msg-id 1843.1411914908@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proper query implementation for Postgresql driver  (Marko Tiikkaja <marko@joh.to>)
Responses Re: Proper query implementation for Postgresql driver  (Shay Rojansky <roji@roji.org>)
List pgsql-hackers
Marko Tiikkaja <marko@joh.to> writes:
> On 9/28/14, 11:53 AM, Shay Rojansky wrote:
>> [ complaint about multiple round trips in extended protocol ]

> You don't have to do multiple round-trips for that; you can just send 
> all the messages in one go.  See how e.g. libpq does it in PQexecParams().

Right.  The key thing to understand is that after an error, the server
skips messages until it sees a Sync.  So you can send out Parse, Bind,
Execute, Sync in one packet and not have to worry that the server will
attempt to execute a query that failed parsing or whatever.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Patch to support SEMI and ANTI join removal
Next
From: Tom Lane
Date:
Subject: Re: Patch to support SEMI and ANTI join removal