Reload bytea [was Re: Picture with Postgres and Delphi] - Mailing list pgsql-general

From Rory Campbell-Lange
Subject Reload bytea [was Re: Picture with Postgres and Delphi]
Date
Msg-id 20031216175727.GC3422@campbell-lange.net
Whole thread Raw
In response to Re: Picture with Postgres and Delphi  (Jonathan Bartlett <johnnyb@eskimo.com>)
Responses Re: Reload bytea [was Re: Picture with Postgres and Delphi]
Re: Reload bytea [was Re: Picture with Postgres and Delphi]
List pgsql-general
[apologies -- this amounts to a cross-post on subject "DB with bytea
types reload problem" -- I'm fairly desperate!]

Hi Jonathan

I saved a db with some bytea columns to text using

    pg_dump -a -d <db> > out.sql

If I go

    psql: \i out.sql

multiple errors result, such as:

    psql:out.sql:505: invalid command \N
    psql:out.sql:505: invalid command \

The sql dump file has lines starting something like this for the photo table:
    1   500 375 h
\\377\\330\\377\\340\\000\\020JFIF\\000\\001\\001\\001\\000H\\000H\\000\\000\\377\\341\\023>Exif\\000\\000MM\\000*\\000\\000\\000\\010\\000\\012\\00....

Is there any way I can retrieve the image data?

Rory

On 10/09/03, Jonathan Bartlett (johnnyb@eskimo.com) wrote:
> > > What is the size limit of bytea, I thought it was 8K?
>
> No limit that I've found.  Some are several meg.
>
> > > How do you dump your database when you have bytea, do you need to do a
> > > binary dump?
>
> Nope.  pg_dump automagically escapes everything.
--
Rory Campbell-Lange
<rory@campbell-lange.net>
<www.campbell-lange.net>

pgsql-general by date:

Previous
From: Rory Campbell-Lange
Date:
Subject: DB with bytea types reload problem
Next
From: Richard Huxton
Date:
Subject: Re: selecting into a variable like @var=select ...