pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paesold <mpaesold@gmx.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: Grégory Chazalon <Gregory.Chazalon@advestigo.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails
Date: Sat, 30 Sep 2006 21:40:50 +0200
Message-ID: <451EC842.4010609@gmx.at> (raw)
In-Reply-To: <15670.1159642557@sss.pgh.pa.us>
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>

Tom Lane schrieb:
 > Michael Paesold <mpaesold@gmx.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




view thread (20+ messages)  latest in thread

Message-ID: <451EC842.4010609@gmx.at>
Permalink:  ../451EC842.4010609@gmx.at/
Also on:    postgresql.org/message-id/451EC842.4010609@gmx.at

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: mpaesold@gmx.at, tgl@sss.pgh.pa.us, pg@fastcrypt.com, Gregory.Chazalon@advestigo.com
  Subject: Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails
  In-Reply-To: <451EC842.4010609@gmx.at>
  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> <451EC842.4010609@gmx.at>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox