From: | Rory Campbell-Lange <rory(at)campbell-lange(dot)net> |
---|---|
To: | Jonathan Bartlett <johnnyb(at)eskimo(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Reload bytea [was Re: Picture with Postgres and Delphi] |
Date: | 2003-12-16 17:57:27 |
Message-ID: | 20031216175727.GC3422@campbell-lange.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | 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(at)eskimo(dot)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(at)campbell-lange(dot)net>
<www.campbell-lange.net>
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Huxton | 2003-12-16 18:12:40 | Re: selecting into a variable like @var=select ... |
Previous Message | Rory Campbell-Lange | 2003-12-16 17:52:59 | DB with bytea types reload problem |