Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails

From: Michael Paesold <mpaesold(at)gmx(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, Grégory Chazalon <Gregory(dot)Chazalon(at)advestigo(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails
Date: 2006-09-30 19:40:50
Message-ID: 451EC842.4010609@gmx.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Tom Lane schrieb:
> Michael Paesold <mpaesold(at)gmx(dot)at> 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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Markus Schaber 2006-09-30 20:49:28 Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails
Previous Message Tom Lane 2006-09-30 18:55:57 Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails