From: | Kris Jurka <books(at)ejurka(dot)com> |
---|---|
To: | Giuseppe Sacco <giuseppe(at)eppesuigoccas(dot)homedns(dot)org> |
Cc: | "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org> |
Subject: | Re: DatabaseMetaData.getExtraNameCharacters |
Date: | 2005-05-25 18:25:25 |
Message-ID: | Pine.BSO.4.56.0505251316330.12535@leary.csoft.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
On Wed, 25 May 2005, Giuseppe Sacco wrote:
> Thanks for your reply, but I would really like to have a list of valid
> or invalid characters in order to test the string before executing the
> statement. There are characters that should be excluded: $%&#^°§[} ...
>
> If the valid characters list is really huge, is there any list of
> invalid characters and a JDBC3.0 method that return it?
The backend lexing rules (src/backend/parser/scan.l) show this for
identifiers:
ident_start [A-Za-z\200-\377_]
ident_cont [A-Za-z\200-\377_0-9\$]
identifier {ident_start}{ident_cont}*
So \200-\377 is octal for any character with the high bit set. The list
of what characters this could map to numbers in the tens of thousands for
unicode, so it's not really feasibly to return in this method.
JDBC does not offer a method to retrieve the list of invalid characters.
I'm guessing because for other databases that number would be the
extremely large list we have for valid ones. The above lexing rules will
tell you though.
Kris Jurka
From | Date | Subject | |
---|---|---|---|
Next Message | Giuseppe Sacco | 2005-05-25 18:51:28 | Re: DatabaseMetaData.getExtraNameCharacters |
Previous Message | Giuseppe Sacco | 2005-05-25 18:10:22 | Re: DatabaseMetaData.getExtraNameCharacters |