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

From Michael Paesold
Subject Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails
Date
Msg-id 451EBBCF.1030902@gmx.at
Whole thread Raw
In response to Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails  (Dave Cramer <pg@fastcrypt.com>)
Responses Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails
Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails
List pgsql-jdbc
Dave Cramer wrote:
 >> I guess it's just a matter of coding, right? Would the JDBC
 >> maintainers accept a patch for the 8.2 release of the driver?
 > Absolutely!

Ok, I am going to write support for this, but I need some help with
determining if a character is valid for a dollar-quote tag. I am
currently looking at the original patch implementing dollar-quoting in
the backend parser, see here:
http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/parser/scan.l.diff?r1=1.114;r2=1.115

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?

- Any ideas how to efficiently check this in Java?
There is Character.isLetter() etc., but this includes all Unicode
letters, not only letters valid as identifiers in the backend.

Otherwise I can still use something like
public static boolean isDollarQuoteStartChar(char c) {
    return (c >= 'A' && c <= 'Z') || ...
}

I am currently working on dollar-quote support in
v3.QueryExecutorImpl.parseQuery(..), but I also want to add it to
V2Query. Where should I put such a static method like
isDollarQuoteStartChar? org.postgresql.core.Utils?

Best Regards
Michael Paesold


pgsql-jdbc by date:

Previous
From: "Sriram Dandapani"
Date:
Subject: Re: [ADMIN] number of transactions doubling
Next
From: Tom Lane
Date:
Subject: Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails