DBD::Pg, bytea type - Mailing list pgsql-interfaces

From Alex Pilosov
Subject DBD::Pg, bytea type
Date
Msg-id Pine.BSO.4.10.10103081425560.5069-100000@spider.pilosoft.com
Whole thread Raw
Responses Re: DBD::Pg, bytea type  (ivan <ivan-pgsql-interfaces@420.am>)
Re: DBD::Pg, bytea type  (Alex Pilosov <alex@acecape.com>)
List pgsql-interfaces
Hiyas,

Currently, there's a problem using bytea type transparently with DBD::Pg
driver. Postgres requires you to quote things in a special way to handle
bytea data, for example, to insert a null character, you have to use 
'\000'. Select, on other hand, will require you to uncode such data before
you can actually use it in perl. 

I'm making patches for DBD::Pg which will properly quote bytea data
before insertion and unquote it on select. Let me know if its not a good
idea.

Another thing: Currently, Pg quote() method only will properly escape
backslash if the datatype is not specified. If the datatype is specified,
it'll give wrong result:
$dbh->quote('foo\\bar', SQL_CHAR) will result in 'foo\bar', but it should
result in 'foo\\bar'. Anyone minds if I fix this one as well?

-alex






pgsql-interfaces by date:

Previous
From: Eivind Andre Fiane Christensen
Date:
Subject: No suitable driver, Using Win2000 connecting to Access
Next
From: Michael Davis
Date:
Subject: RE: No suitable driver, Using Win2000 connecting to Access