Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 540759FB24C for ; Tue, 3 Oct 2006 18:47:13 -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 49396-07 for ; Tue, 3 Oct 2006 18:47:06 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by postgresql.org (Postfix) with SMTP id BAA779FA259 for ; Tue, 3 Oct 2006 18:47:05 -0300 (ADT) Received: (qmail invoked by alias); 03 Oct 2006 21:47:03 -0000 Received: from 85-125-151-228.dynamic.xdsl-line.inode.at (EHLO [127.0.0.1]) [85.125.151.228] by mail.gmx.net (mp042) with SMTP; 03 Oct 2006 23:47:03 +0200 X-Authenticated: #1946847 Message-ID: <4522DA56.4070105@gmx.at> Date: Tue, 03 Oct 2006 23:47:02 +0200 From: Michael Paesold User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org CC: Dave Cramer , Tom Lane Subject: Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails References: <53F8133C991FEC4BA0872D19BAD9694C3B6A70@ADV-SBS.advestigo.loc> <451BAE61.6070802@gmx.at> <11DE4B3E-F76F-42C8-A5A6-2C63E14458AD@fastcrypt.com> <451EBBCF.1030902@gmx.at> <451FC6CD.6060904@gmx.at> In-Reply-To: <451FC6CD.6060904@gmx.at> Content-Type: text/plain; charset=ISO-8859-1; 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.07 tagged_above=0 required=5 tests=AWL, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/33 X-Sequence-Number: 15916 Michael Paesold wrote: > Here is a first version of the patch. It works well for me so far, so > I am asking for comments now. Before everyone forgets about my patch in the discussion about the later patch by Jure Koren... I have already spent some hours on doing research, coding, creating the test case. So I am willing to improve my work, of course. It just much easier with input from the community. I would really welcome any suggestions or criticism. While at it, don't you think that we should handle SQL comments in parseQuery? For example when loading a schema from a file using JDBC, there might be comments in it that will break the current code. Does the JDBC spec say anything about that matter? One other thing that I wanted to try is to not parse the whole query in a single loop, but instead split up the parsing a bit more, in the style of: case '"': scan for next '"'; case '\'': scan for matching '\''; case '$': if dollar-quote, scan for end of dollar-quote It would simplify the other branches of the switch statement and we could get rid of the if (!in... && !in...) stuff, then. Do you think that would be an improvement? Best Regards Michael Paesold