Re: Extended query protocol violation? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Extended query protocol violation?
Date
Msg-id 13855.1440976999@sss.pgh.pa.us
Whole thread Raw
In response to Extended query protocol violation?  (Tatsuo Ishii <ishii@postgresql.org>)
List pgsql-hackers
Tatsuo Ishii <ishii@postgresql.org> writes:
> Notice that JDBC driver sends Parse, Bind and Execute without Sync
> followed then immediately sends another Parse message.

> I wonder if this violates our extended query protocol.

It does not.

> "At completion of each series of extended-query messages, the frontend
> should issue a Sync message."

That's a "should", not a "must".  The important point here is that if the
BEGIN were to fail for some reason, the backend would skip the second
command altogether, since it would skip to the Sync before resuming
processing messages.  If the JDBC driver isn't expecting that behavior,
that's a bug in the driver --- but it's not a protocol violation.  In
fact, the protocol is intentionally designed to let you stack up commands
like that.  It gives you a tradeoff of potential concurrency vs possible
complexity in error recovery handling.
        regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: icc vs. gcc-style asm blocks ... maybe the twain can meet?
Next
From: Michael Paquier
Date:
Subject: Re: Horizontal scalability/sharding