Received: from cleanwhisker.420.am (cleanwhisker.420.am [205.179.65.211]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f28M48x22408 for ; Thu, 8 Mar 2001 17:04:09 -0500 (EST) (envelope-from ivan@420.am) Received: (qmail 14092 invoked by uid 1000); 8 Mar 2001 22:04:05 -0000 Date: Thu, 8 Mar 2001 14:04:05 -0800 From: ivan To: Alex Pilosov Cc: pgsql-interfaces@postgresql.org, E.Mergl@bawue.de Subject: Re: DBD::Pg, bytea type Message-ID: <20010308140404.A12354@cleanwhisker.420.am> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from alex@pilosoft.com on Thu, Mar 08, 2001 at 02:48:16PM -0500 X-Archive-Number: 200103/85 X-Sequence-Number: 1246 On Thu, Mar 08, 2001 at 02:48:16PM -0500, Alex Pilosov wrote: > 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. Surely other 8-bit clean interfaces besides DBD::Pg run into this problem also? Any insights? I'd think that it should be transparant for both the quote() method and placeholders. Placeholders also *segfault* the client (not something we're used to in Perl-land) if you try to use more than 64k of data (not sure if that's per-placeholder, statement, row or something else). > 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? I've heard a variety of different problem reports about quote(). Here's a patch one of my cow orkers sent me: http://www.postgresql.org/mhonarc/pgsql-interfaces/2001-02/msg00199.html -- meow _ivan