Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Zjxms-0004pU-Bl for pgsql-jdbc@arkaria.postgresql.org; Wed, 07 Oct 2015 23:06:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1Zjxmr-0000H1-1e for pgsql-jdbc@arkaria.postgresql.org; Wed, 07 Oct 2015 23:06:17 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZjxmL-0008AE-Kf for pgsql-jdbc@postgresql.org; Wed, 07 Oct 2015 23:05:45 +0000 Received: from mbob.nabble.com ([162.253.133.15]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZjxmE-0004vh-2B for pgsql-jdbc@postgresql.org; Wed, 07 Oct 2015 23:05:44 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mbob.nabble.com (Postfix) with ESMTP id 7DC671730FF4 for ; Wed, 7 Oct 2015 15:58:15 -0700 (PDT) Date: Wed, 7 Oct 2015 16:05:37 -0700 (MST) From: bocap To: pgsql-jdbc@postgresql.org Message-ID: In-Reply-To: References: <21DDBBC0-6A6E-4B9B-9A25-C0044EAF5250@gmail.com> <5615678C.4000005@labkey.com> Subject: Re: JDBC-94: "Multiple resultsets were returned by query" in query end with "; " MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_111380_1461658220.1444259137727" X-Pg-Spam-Score: -0.1 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org ------=_Part_111380_1461658220.1444259137727 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi, Thanks all. Ng=C3=A0y 08-10-2015, v=C3=A0o l=C3=BAc 03:47, Dave Cramer-8 [via PostgreSQ= L] vi=E1=BA=BFt: > I've pushed the PR so the next version will not do this >=20 I hope i could use it soon > Dave Cramer >=20 > dave.cramer(at)credativ(dot)ca > http://www.credativ.ca >=20 >> On 7 October 2015 at 14:42, Adam Rauch <[hidden email]> wrote: >> I agree with Christopher. After upgrading to the latest JDBC driver our = system started throwing these exceptions. It's not hard for us to fix (I ca= n update our own framework code), but it seems unnecessary and is likely mo= re difficult for others to address. >>=20 >> Here's a simplified example of SQL-generatation code that runs afoul of = this change: in our system, a logical insert at one layer may map to multip= le database inserts (e.g., to a primary database table plus one or more pro= perty tables). The code generating the insert SQL terminates each INSERT wi= th ";\n", for convenience and human readability. As a result, the final INS= ERT can end with a dangling "\n" that 1202 now rejects. Of course, we could= duplicate a subsequent check and/or special case the last INSERT to remove= the "\n", but the current code is cleaner. >>=20 >> Adam >>=20 >>=20 >>> On 10/7/2015 5:42 AM, Christopher BROWN wrote: >>> Hello, >>>=20 >>> Developers that use the driver via a framework (open-source, in-house) = might not be in a position to change SQL, compared with developers that are= able to modify hand-written SQL, so it's probably best to tolerate it by d= iscarding any trailing semi-colon (with or without any trailing whitespace)= in the parser. >>>=20 >>> I've also encountered coding practices (coding-style "standards") where= semi-colons are expected (some people just love terminating all statements= , not just Java, with semi-colons, even when it's not strictly necessary (e= .g.: JavaScript). >>>=20 >>> So, my preference would be to maintain backwards-compatibility for othe= rs, even if I don't have such an issue myself. >>>=20 >>> -- >>> Christopher >>>=20 >>>=20 >>>> On 7 October 2015 at 14:34, Dave Cramer <[hidden email]> wrote: >>>> This is a very good question, but lots of people cut and paste SQL int= o code ... sometimes the ; gets in there. >>>>=20 >>>> Behaviour of previous version is important, but in this case It may no= t be justified. >>>>=20 >>>> Anyone else have an opinion ? >>>>=20 >>>> Dave Cramer >>>>=20 >>>> dave.cramer(at)credativ(dot)ca >>>> http://www.credativ.ca >>>>=20 >>>>> On 7 October 2015 at 08:30, Vladimir Sitnikov <[hidden email][hidden = email]> wrote: >>>>> I wonder why pgjdbc would want to silently ignore that user error? >>>>> Is "behavior of previous version" a sole justification? >>>>>=20 >>>>> I've drafted https://github.com/pgjdbc/pgjdbc/pull/386 to cover that. >>>>>=20 >>>>> Vladimir >=20 >=20 >=20 > If you reply to this email, your message will be added to the discussion = below: > http://postgresql.nabble.com/JDBC-94-Multiple-resultsets-were-returned-by= -query-in-query-end-with-tp5867835p5869173.html > To unsubscribe from JDBC-94: "Multiple resultsets were returned by query"= in query end with "; ", click here. > NAML Regards, Bocap -- View this message in context: http://postgresql.nabble.com/JDBC-94-Multiple= -resultsets-were-returned-by-query-in-query-end-with-tp5867835p5869215.html Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com. ------=_Part_111380_1461658220.1444259137727 Content-Type: text/html; charset=UTF8 Content-Transfer-Encoding: quoted-printable Hi,

Thanks all.

Ng=C3=A0y 08-10-2= 015, v=C3=A0o l=C3=BAc 03:47, Dave Cramer-8 [via PostgreSQL] <[hidden email]> vi=E1=BA=BFt:
=09
I've pushed the PR so the next version will not do this=


I hope i could use it soon

Dave Cramer

dave.cr= amer(at)credativ(dot)ca
http://www.credativ.ca

On 7 October 2015 at 14:42, Adam Rauch <[hidden e= mail]> wrote:
=20 =20 =20
I agree with Christopher. After upgrading to the latest JDBC driver our system started throwing these exceptions. It's not hard for us to fix (I can update our own framework code), but it seems unnecessary and is likely more difficult for others to address.

Here's a simplified example of SQL-generatation code that runs afoul of this change: in our system, a logical insert at one layer may map to multiple database inserts (e.g., to a primary database table plus one or more property tables). The code generating the insert SQL terminates each INSERT with ";\n", for convenience and human readability. As a result, the final INSERT can end with a dangling "\n" that 1202 now rejects. Of course, we could duplicate a subsequent check and/or special case the last INSERT to remove the "\n", but the current code is cleaner.

Adam


On 10/7/2015 5:42 AM, Christopher BROWN wrote:
Hello,

Developers that use the driver via a framework (open-source, in-house) might not be in a position to change SQL, compared with developers that are able to modify hand-written SQL, so it's probably best to tolerate it by discarding any trailing semi-colon (with or without any trailing whitespace) in the parser.

I've also encountered coding practices (coding-style "standards") where semi-colons are expected (some people just love terminating all statements, not just Java, with semi-colons, even when it's not strictly necessary (e.g.: JavaScript).

So, my preference would be to maintain backwards-compatibility for others, even if I don't have such an issue myself.

--
Christopher


On 7 October 2015 at 14:34, Dave Cramer <[hidden email]> wrote:
This is a very good question, but lots of people cut and paste SQL into code ... sometimes the ; gets in there.

Behaviour of previous version is important, but in this case It may not be justified.

Anyone else have an opinion ?

Dave Cramer

dave.cramer(at)credativ(dot)ca
http://www.credativ.ca

On 7 October 2015 at 08:30, Vladimir Sitnikov <[hidden email][hidden email]> wrote:
I wonder why pgjdbc would want to silently ignore that user error?
Is "behavior of previous version" a sole justification?

I've drafted https://gi= thub.com/pgjdbc/pgjdbc/pull/386 to cover that.

Vladimir




=09 =09 =09 =09
=09
=09
=09
=09=09
If you reply to this email, your mess= age will be added to the discussion below:
=09=09http://postgresql.nabble.com/JDBC-9= 4-Multiple-resultsets-were-returned-by-query-in-query-end-with-tp5867835p58= 69173.html =09
=09
=09=09 =09=09To unsubscribe from JDBC-94: "Multiple resultsets were returned by qu= ery" in query end with "; ", click here.
=09=09NAML =09

Regards,
Bocap
=09 =09 =09

View this message in context: Re: JDBC-94: "Multiple resultsets were returned by query&= quot; in query end with "; "
Sent from the PostgreSQL - jdbc mailing list archive at Nabble.com.
------=_Part_111380_1461658220.1444259137727--