Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C1E7E9FB21B for ; Tue, 3 Oct 2006 14:00:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 93159-05 for ; Tue, 3 Oct 2006 14:00:35 -0300 (ADT) X-Greylist: delayed 01:05:49.40548 by SQLgrey- Received: from vimes.neko.si (vimes.neko.si [213.161.22.88]) by postgresql.org (Postfix) with ESMTP id 6C70E9FA4F4 for ; Tue, 3 Oct 2006 14:00:35 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by vimes.neko.si (Postfix) with ESMTP id 7C030BCC5 for ; Tue, 3 Oct 2006 19:00:34 +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 24484-09 for ; Tue, 3 Oct 2006 19:00:28 +0200 (CEST) Received: from inna.home (sui.neko.si [193.77.34.35]) by vimes.neko.si (Postfix) with ESMTP id D4643BCF2 for ; Tue, 3 Oct 2006 19:00:27 +0200 (CEST) From: Jure Koren Organization: Hehe d.o.o. To: pgsql-jdbc@postgresql.org Subject: Re: dollar quoting Date: Tue, 3 Oct 2006 19:00:23 +0200 User-Agent: KMail/1.9.1 References: <200610031754.38595.jure@hehe.si> In-Reply-To: <200610031754.38595.jure@hehe.si> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart9360270.xtxBEL6QCj"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200610031900.26121.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/22 X-Sequence-Number: 15905 --nextPart9360270.xtxBEL6QCj Content-Type: multipart/mixed; boundary="Boundary-01=_ocpIF+Gy+ZTb8N1" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_ocpIF+Gy+ZTb8N1 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 03 October 2006 17:54, Jure Koren wrote: > Hello! > I've added dollar quoting support to the 8.2dev-503 version query parser. Well, it's really not that big, so here it is. Though it works for me and I've tried to read the dollar quoting definition= in=20 the postgresql docs several times, I can't really be sure if it's correct :) If anyone bothers enough with it to find a problem, you can let me know. Regards, =2D-=20 Jure Koren, unix developer Hehe d.o.o. --Boundary-01=_ocpIF+Gy+ZTb8N1 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-04-29 15:30:24.000000000 +0200 +++ postgresql-jdbc-8.2dev-503.src-dq/org/postgresql/core/v3/QueryExecutorI= mpl.java 2006-10-03 17:41:06.000000000 +0200 @@ -99,6 +99,21 @@ } break; =20 + case '$': + int pos =3D query.indexOf('$', i+1); + if (pos < 0) + break; + String tag =3D query.substring(i+1, pos); + String nexttag =3D new StringBuilder(tag).insert(0, "$").a= ppend("$").toString(); + int nextpos =3D query.indexOf(nexttag, pos+1); + if (nextpos < 0) + break; + i =3D nextpos + tag.length() + 2; + break; + case '(': if (!inSingleQuotes && !inDoubleQuotes) inParen++; --Boundary-01=_ocpIF+Gy+ZTb8N1-- --nextPart9360270.xtxBEL6QCj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (GNU/Linux) iD8DBQBFIpcq9iFCvmuhrCIRArW5AKDWMbxkoEl7xByKLH5w7I3E4TImAwCcCEI2 lgig7vLVRoELGRt4m8fiGZI= =EE/Q -----END PGP SIGNATURE----- --nextPart9360270.xtxBEL6QCj--