Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id 814C7475892 for ; Wed, 17 Jul 2002 12:08:55 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.5/8.12.5) with ESMTP id g6HG8xAl014472; Wed, 17 Jul 2002 12:08:59 -0400 (EDT) To: James Orr Cc: pgsql-interfaces@postgresql.org Subject: Re: bytea on windows perl client In-reply-to: <200207171201.25600.james@lrgmail.com> References: <200207171201.25600.james@lrgmail.com> Comments: In-reply-to James Orr message dated "Wed, 17 Jul 2002 12:01:25 -0400" Date: Wed, 17 Jul 2002 12:08:59 -0400 Message-ID: <14471.1026922139@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200207/100 X-Sequence-Number: 2909 James Orr writes: > I have some code which runs fine on linux. It simply pulls a png from a bytea > column and displays it. > Now I need to get it running on windows. We have installed ActiveState perl > with the DBI module and downloaded and installed the DBD-Pg binary. > Connections to the database are working fine, but the png file is getting > corrupted. > Anybody know the work-around? I'd bet money that the problem is a newline conversion issue --- you could check by noticing whether the PNG signature (first 8 bytes of the file) comes back correctly or not. The signature is designed to get changed if it's fed through any of the standard kinds of newline conversion (\n -> \r\n, for example). Not that this gives any immediate suggestion for a fix, but understanding what is happening is always a good first step. regards, tom lane