Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id DF04A9FB254 for ; Tue, 3 Oct 2006 16:38:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 90704-04 for ; Tue, 3 Oct 2006 19:38:34 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from vimes.neko.si (vimes.neko.si [213.161.22.88]) by postgresql.org (Postfix) with ESMTP id 471309FB24C for ; Tue, 3 Oct 2006 16:38:34 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by vimes.neko.si (Postfix) with ESMTP id 11E0DBCC3 for ; Tue, 3 Oct 2006 21:38:33 +0200 (CEST) Received: from vimes.neko.si ([127.0.0.1]) by localhost (vimes.neko.si [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31153-10 for ; Tue, 3 Oct 2006 21:38:30 +0200 (CEST) Received: from inna.home (sui.neko.si [193.77.34.35]) by vimes.neko.si (Postfix) with ESMTP id 0A6F2BCE6 for ; Tue, 3 Oct 2006 21:38:30 +0200 (CEST) From: Jure Koren Organization: Hehe d.o.o. To: pgsql-jdbc@postgresql.org Subject: Re: dollar quoting Date: Tue, 3 Oct 2006 21:38:19 +0200 User-Agent: KMail/1.9.1 References: <200610031754.38595.jure@hehe.si> <4F543962-492E-4455-AA44-EE0D91017DEC@fastcrypt.com> <9032.1159899269@sss.pgh.pa.us> In-Reply-To: <9032.1159899269@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart7078867.WpftsD3KLU"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200610032138.28215.jure@hehe.si> X-Virus-Scanned: amavisd-new at neko.si X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200610/27 X-Sequence-Number: 15910 --nextPart7078867.WpftsD3KLU Content-Type: multipart/mixed; boundary="Boundary-01=_swrIFxnKZpt19FM" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_swrIFxnKZpt19FM Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 03 October 2006 20:14, Tom Lane wrote: > Also, this patch is not being nearly cautious enough about what is a > valid dollar-quote start sequence. The other patch that was proposed > looked more reasonable on that score. Yes. This is the version that I think addresses most of the concerns posted. Thank you for your feedback. =2D-=20 Jure Koren, unix developer Hehe d.o.o. --Boundary-01=_swrIFxnKZpt19FM Content-Type: text/x-diff; charset="iso-8859-15"; name="postgresql-jdbc-dollarquote.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="postgresql-jdbc-dollarquote.diff" diff -ru postgresql-jdbc-8.2dev-503.src/org/postgresql/core/v3/QueryExecuto= rImpl.java postgresql-jdbc-8.2dev-503.src-dq/org/postgresql/core/v3/QueryEx= ecutorImpl.java =2D-- postgresql-jdbc-8.2dev-503.src/org/postgresql/core/v3/QueryExecutorIm= pl.java 2006-10-03 19:06:00.000000000 +0200 +++ postgresql-jdbc-8.2dev-503.src-dq/org/postgresql/core/v3/QueryExecutorI= mpl.java 2006-10-03 21:34:34.000000000 +0200 @@ -99,6 +99,21 @@ } break; =20 + case '$': + if (inDoubleQuotes || inSingleQuotes) + break; + int pos =3D query.indexOf('$', i+1); + if (pos < 0) + break; + String tag =3D query.substring(i, pos+1); + if (!tag.matches("^\\$[\\p{L}_][\\p{L}\\d_]*\\$$")) + break; + int nextpos =3D query.indexOf(tag, pos+1); + if (nextpos < 0) + break; + i =3D nextpos + tag.length() + 2; + break; + case '(': if (!inSingleQuotes && !inDoubleQuotes) inParen++; --Boundary-01=_swrIFxnKZpt19FM-- --nextPart7078867.WpftsD3KLU Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBFIrw09iFCvmuhrCIRAhlzAJwKJ/IUIFmjpL6PYF8BtBfGzMX+zgCg8WNC ZMkiburURRrrtmXQ8PpURBI= =yZuk -----END PGP SIGNATURE----- --nextPart7078867.WpftsD3KLU--