Re: Need help importing dump with bytea into db - Mailing list pgsql-novice

From Tom Lane
Subject Re: Need help importing dump with bytea into db
Date
Msg-id 14626.1344867809@sss.pgh.pa.us
Whole thread Raw
In response to Need help importing dump with bytea into db  (Philippe Dirkse <philippe.dirkse@alten.nl>)
List pgsql-novice
Philippe Dirkse <philippe.dirkse@alten.nl> writes:
> I have the strangest problem. Scenario: Server running postgresql 8.4.10, 32-bit Ubuntu, local machine running
postgresql9.1.4, 64-bit OSX Snow Leopard. I want to create a local copy of the database running on the server for
developmentpurposes, as the server database is 'live'. 

> So, on my Mac I use pg_dump to create a dump from the server database. This database contains one table that has a
byteacolumn which stores pictures (png,jpg). Examining the dump, I see this data is 'escaped' as octects for all
'non-readable'characters. Now, when I use psql (or pg_restore for that matter) to import the dump into my local
database,the bytea data is not 'unescaped' properly. It appears as if the characters for the string representation of
theactual bytes are returned.  

My first guess is that there's nothing actually wrong with the data, but
you're getting confused by the fact that 9.1 by default outputs bytea
data in hex rather than the traditional "escaped" format.  See the
bytea_output configuration parameter.

            regards, tom lane


pgsql-novice by date:

Previous
From: Philippe Dirkse
Date:
Subject: Need help importing dump with bytea into db
Next
From: Michael Wood
Date:
Subject: Re: how to get desired html format output?