Re: Using java.lang.Character for "char" data type

Поиск
Список
Период
Сортировка
От Lew
Тема Re: Using java.lang.Character for "char" data type
Дата
Msg-id ht8thg$q6a$1@news.albasani.net
обсуждение исходный текст
Ответ на Re: Using java.lang.Character for "char" data type  (Craig Ringer <craig@postnewspapers.com.au>)
Список pgsql-jdbc
Kris Jurka wrote:
>> It would be possible to support setObject for a Character, but be aware
>> that "char" is not a character long, it's a byte long, so it will fail
>> on multibyte characters.

Craig Ringer wrote:
> So really the appropriate SQL type for Java 'Character' is varchar(1) ?
> And a PostgreSQL 'char' (bpchar, not character(1)) maps best to a Java
> 'Byte' ?

Not according to the PG documentation.

According to that, SQL type "CHAR" should be just fine for a Java 'char'.
Mostly.  (I worry about code points that take more than 2 bytes.)

I would not use "VARCHAR" to represent a Java 'char'.

--
Lew

В списке pgsql-jdbc по дате отправления: