Re: Strings with null characters produce exceptions when selected or inserted. Attempts to select messages with null bytes produces "ERROR: insufficient data left in message". And inserting produces "ERROR: invalid byte sequence for encoding \"UTF8\": 0x00". Since a null character is a valid UTF code point why is it rejected by the JDBC driver? The attached test can work with Mysql and their JDBC driver.

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Strings with null characters produce exceptions when selected or inserted. Attempts to select messages with null bytes produces "ERROR: insufficient data left in message". And inserting produces "ERROR: invalid byte sequence for encoding \"UTF8\": 0x00". Since a null character is a valid UTF code point why is it rejected by the JDBC driver? The attached test can work with Mysql and their JDBC driver.
Дата
Msg-id alpine.BSO.2.00.0906031639270.2432@leary.csoft.net
обсуждение исходный текст
Ответ на Strings with null characters produce exceptions when selected or inserted. Attempts to select messages with null bytes produces "ERROR: insufficient data left in message". And inserting produces "ERROR: invalid byte sequence for encoding \"UTF8\": 0x00". Since a null character is a valid UTF code point why is it rejected by the JDBC driver? The attached test can work with Mysql and their JDBC driver.  (user2037@ymail.com)
Ответы Re: Strings with null characters produce exceptions when selected or inserted. Attempts to select messages with null bytes produces "ERROR: insufficient data left in message". And inserting produces "ERROR: invalid byte sequence for encoding \"UTF8\": 0x00". Since a null character is a valid UTF code point why is it rejected by the JDBC driver? The attached test can work with Mysql and their JDBC driver.
Список pgsql-jdbc

On Wed, 3 Jun 2009, user2037@ymail.com wrote:

> Strings with null characters produce exceptions when selected or
> inserted. Attempts to select messages with null bytes produces "ERROR:
> insufficient data left in message". And inserting produces "ERROR:
> invalid byte sequence for encoding \"UTF8\": 0x00".
>
> Since a null character is a valid UTF code point why is it rejected by
> the JDBC driver?

Because the server can't handle it.  The server is written in C and tracks
all textual data as C strings which are null terminated.  It cannot handle
intermediate null bytes, so the driver is just providing that message as
early as possible to you.

Kris Jurka

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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: Headless Exception
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: jdbc excpetions in pg