pg.ddx.io pgsql-jdbc@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Giuseppe Sacco <giuseppe@eppesuigoccas.homedns.org>
To: pgsql-jdbc@postgresql.org
Subject: Re: DatabaseMetaData.getExtraNameCharacters
Date: Thu, 26 May 2005 10:43:51 +0200
Message-ID: <1117097031.3667.27.camel@localhost> (raw)
In-Reply-To: <Pine.BSO.4.56.0505251452050.30233@leary.csoft.net>
References: <1117034023.27493.10.camel@localhost>
<Pine.BSO.4.56.0505251204190.29241@leary.csoft.net>
<1117044622.27459.28.camel@localhost>
<Pine.BSO.4.56.0505251316330.12535@leary.csoft.net>
<1117047088.27493.36.camel@localhost>
<Pine.BSO.4.56.0505251452050.30233@leary.csoft.net>
Il giorno mer, 25-05-2005 alle 14:59 -0500, Kris Jurka ha scritto:
[...]
> You are assuming that each character is only one byte. The backend lexing
> rules are a byte by byte operation, but the JDBC side is returning a
> String of characters. Consider the character "Latin Small Letter s with
> Acute" (\u015B) gets encoded in UTF-8 as C5 9B or \305\233 in octal. This
> is one character in the result of getExtraNameCharacters.
Thank you very much for your reply.
Yes, I assumed that this was a one-byte character encoding and I didn't
know that \200 < \305\233 < \377.
I was also assuming (maybe wrongly) that JDBC driver convert java utf-8
characters to ASCII when connecting to postgresql backend. This is why I
counted 191 characters.
I also made a test: "CREATE TABLE A\u015B ( A VARCHAR(30) )"
fails when calling java.sql.Statement.execute(). The error is:
ERROR: syntax error at or near "["
Looking at the postgresql log, I found the statement was translated in
"CREATE TABLE A[ ( A VARCHAR(30))"
Similarly, "CREATE TABLE A\u00C0 ( A VARCHAR(30) )" succeeds.
so maybe postgresql doesn't accept a broad range of utf-8 characters,
while it might accept the ASCII characters from \200 to \377 when it is
a Character.isLetterOrDigit().
May it be something dependant on the database encoding?
Thanks again,
Giuseppe
view thread (7+ messages)
Message-ID: <1117097031.3667.27.camel@localhost> Permalink: ../1117097031.3667.27.camel@localhost/ Also on: postgresql.org/message-id/1117097031.3667.27.camel@localhost ·
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: giuseppe@eppesuigoccas.homedns.org Subject: Re: DatabaseMetaData.getExtraNameCharacters In-Reply-To: <1117097031.3667.27.camel@localhost> References: <1117034023.27493.10.camel@localhost> <Pine.BSO.4.56.0505251204190.29241@leary.csoft.net> <1117044622.27459.28.camel@localhost> <Pine.BSO.4.56.0505251316330.12535@leary.csoft.net> <1117047088.27493.36.camel@localhost> <Pine.BSO.4.56.0505251452050.30233@leary.csoft.net> <1117097031.3667.27.camel@localhost> * 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