DBD::Pg, bytea type

From: Alex Pilosov <alex(at)pilosoft(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Cc: E(dot)Mergl(at)bawue(dot)de
Subject: DBD::Pg, bytea type
Date: 2001-03-08 19:48:16
Message-ID: Pine.BSO.4.10.10103081425560.5069-100000@spider.pilosoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-interfaces by date

  From Date Subject
Next Message Michael Davis 2001-03-08 19:50:50 RE: No suitable driver, Using Win2000 connecting to Access
Previous Message Eivind Andre Fiane Christensen 2001-03-08 17:04:53 No suitable driver, Using Win2000 connecting to Access