Search Postgresql Archives

Re: UTF-8 context of BYTEA datatype??

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment: signature.asc
Description: Digital signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux