Thread: Issues with imported blobs from Postgres 8 to 9

Issues with imported blobs from Postgres 8 to 9

From
Mahdi Mankai
Date:
Hi,

I created a database dumb using pg_dump on Postgres 8.3.6. After that I tried to import the same database into a Postgres 9.0 install. Everything worked fine except some image blobs. Some of them seem to be corrupt.

OS: Mac OS X Server 10.5.8. The same issue happened on Mac OS X client 10.6.6.

I downloaded the Postgres 9 version taken from Enterprise DB. I also tried the one from http://www.postgresqlformac.com/ since my initial database was created in Postgres 8 downloaded from there. I had the same issue.

In some forums, it was mentioned that I needed to set bytea_output = 'escape' in the config file. Which I did with no luck even after deleting and importing the DB again.

Any suggestion?

Thanks,

Mahdi

Re: Issues with imported blobs from Postgres 8 to 9

From
Tom Lane
Date:
Mahdi Mankai <mahdi.mankai@fuegoondemand.com> writes:
> I created a database dumb using pg_dump on Postgres 8.3.6. After that I tried to import the same database into a
Postgres9.0 install. Everything worked fine except some image blobs. Some of them seem to be corrupt. 

I doubt this is a bytea_escape problem.  In the first place that would
only affect output from the new server, not input into it; and in the
second place, if that were the issue, it would probably result in *all*
your blobs being messed up not just a small number of them.  We need
a lot more details than this to offer any help.

            regards, tom lane

Re: Issues with imported blobs from Postgres 8 to 9

From
Mahdi Mankai
Date:
Thanks for the reply.

What kind of detail can I provide?

Mahdi

On 2011-02-28, at 6:58 PM, Tom Lane wrote:

> Mahdi Mankai <mahdi.mankai@fuegoondemand.com> writes:
>> I created a database dumb using pg_dump on Postgres 8.3.6. After that I tried to import the same database into a
Postgres9.0 install. Everything worked fine except some image blobs. Some of them seem to be corrupt. 
>
> I doubt this is a bytea_escape problem.  In the first place that would
> only affect output from the new server, not input into it; and in the
> second place, if that were the issue, it would probably result in *all*
> your blobs being messed up not just a small number of them.  We need
> a lot more details than this to offer any help.
>
>             regards, tom lane
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general


Re: Issues with imported blobs from Postgres 8 to 9

From
"David Johnston"
Date:
Is there a way you can dump the same image in hex format (or even
PostgreSQL's own escape format) from both the 8.3.6 and 9.0.X setup (with
bytea_escape set to escape) and do a file comparison between the two to at
least show that the results are different?  As I have not actually ever done
this I am only guessing but I would think it should work.  If you have a
record that IS correctly displaying you can use it as a control.

Also, you fail to indicate what GUI and/or middle-tier tools you are using
to retrieve and display the image (or save the file locally to display in a
viewer).  Along the same lines where are you seeing errors related to these
images - and what are they?  You also say "some" but is that because you
have only tested a few or are there some that are coming across just fine?

David J.

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org] On Behalf Of Mahdi Mankai
Sent: Tuesday, March 01, 2011 6:08 AM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] Issues with imported blobs from Postgres 8 to 9

Thanks for the reply.

What kind of detail can I provide?

Mahdi

On 2011-02-28, at 6:58 PM, Tom Lane wrote:

> Mahdi Mankai <mahdi.mankai@fuegoondemand.com> writes:
>> I created a database dumb using pg_dump on Postgres 8.3.6. After that I
tried to import the same database into a Postgres 9.0 install. Everything
worked fine except some image blobs. Some of them seem to be corrupt.
>
> I doubt this is a bytea_escape problem.  In the first place that would
> only affect output from the new server, not input into it; and in the
> second place, if that were the issue, it would probably result in
> *all* your blobs being messed up not just a small number of them.  We
> need a lot more details than this to offer any help.
>
>             regards, tom lane
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To
> make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make
changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general