Re: UTF-8 context of BYTEA datatype??

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: UTF-8 context of BYTEA datatype??
Дата
Msg-id 20060530204705.GE2708@svana.org
обсуждение исходный текст
Ответ на Re: UTF-8 context of BYTEA datatype??  (Rafal Pietrak <rafal@zorro.isa-geek.com>)
Ответы Re: UTF-8 context of BYTEA datatype??  (Rafal Pietrak <rafal@zorro.isa-geek.com>)
Re: UTF-8 context of BYTEA datatype??  ("Daniel Verite" <daniel@manitou-mail.org>)
Список pgsql-general
On Tue, May 30, 2006 at 10:26:31PM +0200, Rafal Pietrak wrote:
> Now, this is probably not exactly the furum to discuss that, but:
> 1. I did quite a few scripts with DBI, not only for  Postgesql in fact -
> scripts worked flowlessly between Oracle/Sybase and the old DBASE files,
> too. And I have never fell into a problem of missing the an include for
> a particular driver - simple "use DBI;" did all the magic.
> 2. I admitt, that I should have spotted myself, that the
> DBD::Pg::PG_BYTEA might not have been recognized without the use
> clausure, but the driver itself understands prity much of the
> underlaying datatypes - I fon't need to bind explicitly for SQL_DATE or
> SQL_INTEGER. Why should I care more for binary objects?

Well actually, the driver doesn't understand any datatypes at all,
that's the problem. What's happening is that to send the query to the
server, the driver has to load all your paramters into the query string
and send it. And the server has to decode it all before it's even
looked at the string so it has no idea it's a bytea.

That's why bytea need special encoding to get around this check.

However, there is a solution: send the paramters seperate from the
query. In fact, postgres has been able to do that for a while now but
not all interfaces have been made to use it. My guess is that those
other databases you've used were already doing this so didn't see the
issue. I don't know if DBD:Pg does this though, maybe it needs to be
triggered somehow.

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: Alexander Scholz
Дата:
Сообщение: Problem V8.1.4 - providing pwd for commandline tools doesn't work anymore
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Restoring databases from a different installment on Windows