Re: Proper query implementation for Postgresql driver

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marko Tiikkaja <marko(at)joh(dot)to>
Cc: Shay Rojansky <roji(at)roji(dot)org>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Proper query implementation for Postgresql driver
Date: 2014-09-28 14:35:08
Message-ID: 1843.1411914908@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Marko Tiikkaja <marko(at)joh(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-09-28 14:41:56 Re: Patch to support SEMI and ANTI join removal
Previous Message Andres Freund 2014-09-28 13:41:12 Re: Patch to support SEMI and ANTI join removal