Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 2A39A9FB254 for ; Tue, 3 Oct 2006 17:13:45 -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 93850-10 for ; Tue, 3 Oct 2006 20:13:35 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.gmx.net (mail.gmx.de [213.165.64.20]) by postgresql.org (Postfix) with SMTP id 896D29FB324 for ; Tue, 3 Oct 2006 17:13:34 -0300 (ADT) Received: (qmail invoked by alias); 03 Oct 2006 20:13:32 -0000 Received: from 85-125-151-228.dynamic.xdsl-line.inode.at (EHLO [192.168.1.16]) [85.125.151.228] by mail.gmx.net (mp034) with SMTP; 03 Oct 2006 22:13:32 +0200 X-Authenticated: #1946847 Message-ID: <4522C47C.4050607@gmx.at> Date: Tue, 03 Oct 2006 22:13:48 +0200 From: Michael Paesold User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: dollar quoting References: <200610031754.38595.jure@hehe.si> <9032.1159899269@sss.pgh.pa.us> <200610032138.28215.jure@hehe.si> <200610032146.37524.jure@hehe.si> In-Reply-To: <200610032146.37524.jure@hehe.si> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.134 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/30 X-Sequence-Number: 15913 Jure Koren wrote: > On Tuesday 03 October 2006 21:38, Jure Koren wrote: >> This is the version that I think addresses most of the concerns posted. > > Except for the empty ($$) tag, which this, hopefully last version, does as > well. Some more comments: - I don't think the regular expression is quite there yet, look at the code in the other patch -- the "c > 127" part - Having said that, I don't believe in compiling a regular expression for each dollar-quoted string and each $ character that is not part of a dollar quote - There must be something wrong with this line at the end of a dollar-quote: i = nextpos + tag.length() + 2; My other patch has this here: i += dollarQuoteTag.length() - 1; "nextpos" in the first case should be the same as "i" in the second case. Something like ..$$String$$; SELECT ... will break here, I guess. My patch included JUnit tests to detect such off-by-one-or-more errors. You could use them. I am now wondering which version has the better performance... especially I would like to know if switching between scanning the char[] and the original query string in this patch has any negative impact. If not, it could be applied quite easily to the other one. Perhaps you could evaluate both versions for performance? Best Regards, Michael Paesold