Re: bytea on windows perl client - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: bytea on windows perl client
Date
Msg-id 14471.1026922139@sss.pgh.pa.us
Whole thread Raw
In response to bytea on windows perl client  (James Orr <james@lrgmail.com>)
Responses Re: bytea on windows perl client
List pgsql-interfaces
James Orr <james@lrgmail.com> 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


pgsql-interfaces by date:

Previous
From: James Orr
Date:
Subject: bytea on windows perl client
Next
From: James Orr
Date:
Subject: Re: bytea on windows perl client