Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 4F77B9FB212 for ; Sat, 30 Sep 2006 16:40:57 -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 40747-01 for ; Sat, 30 Sep 2006 19:40:53 +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 E767E9FB1D5 for ; Sat, 30 Sep 2006 16:40:52 -0300 (ADT) Received: (qmail invoked by alias); 30 Sep 2006 19:40:50 -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 (mp017) with SMTP; 30 Sep 2006 21:40:50 +0200 X-Authenticated: #1946847 Message-ID: <451EC842.4010609@gmx.at> Date: Sat, 30 Sep 2006 21:40:50 +0200 From: Michael Paesold User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Tom Lane CC: Dave Cramer , =?ISO-8859-15?Q?Gr=E9gory_Chazalon?= , pgsql-jdbc@postgresql.org 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> <15670.1159642557@sss.pgh.pa.us> In-Reply-To: <15670.1159642557@sss.pgh.pa.us> 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: 200609/162 X-Sequence-Number: 15880 Tom Lane schrieb: > Michael Paesold writes: >> scan.l defines: >> dolq_start [A-Za-z\200-\377_] >> dolq_cont [A-Za-z\200-\377_0-9] > >> Some questions here: >> - What are the \200-\377 characters? > > Basically, that's going to cover any non-7-bit-ASCII character > (including multibyte characters). I'm not sure if Java has an > equivalent of ctype.h's isascii() but that'd probably be what > you want to use. Checking if the Unicode code point is > 127 > would work too, if Java lets you do that. Ok, CharUtils of commons-lang of Apache.org defines isAscii as simply as: public static boolean isAscii(char ch) { return (ch < 128); } So something like this should do the trick: public static boolean isDollarQuoteStartChar(char c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c == '_') || (c > 127); } (c > 127) should be the same as (c >= '\200'), but I find the first one more readable. I am probably not used to reading hex numbers. ;-) Thanks for your help. Best Regards Michael Paesold