Re: DatabaseMetaData.getExtraNameCharacters - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: DatabaseMetaData.getExtraNameCharacters
Date
Msg-id Pine.BSO.4.56.0505251316330.12535@leary.csoft.net
Whole thread Raw
In response to Re: DatabaseMetaData.getExtraNameCharacters  (Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>)
Responses Re: DatabaseMetaData.getExtraNameCharacters
List 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


pgsql-jdbc by date:

Previous
From: Giuseppe Sacco
Date:
Subject: Re: DatabaseMetaData.getExtraNameCharacters
Next
From: Giuseppe Sacco
Date:
Subject: Re: DatabaseMetaData.getExtraNameCharacters