From: | Jonathan Bartlett <johnnyb(at)eskimo(dot)com> |
---|---|
To: | Rory Campbell-Lange <rory(at)campbell-lange(dot)net> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Reload bytea [was Re: Picture with Postgres and Delphi] |
Date: | 2003-12-16 18:57:09 |
Message-ID: | Pine.GSU.4.44.0312161056200.6919-100000@eskimo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
It's always worked for me just by typing from the command line:
psql -U USERNAME DBNAME < backup.sql
Jon
On Tue, 16 Dec 2003, Rory Campbell-Lange wrote:
> [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 | Paul Ganainm | 2003-12-16 18:59:24 | Re: add column sillyness |
Previous Message | Joe Conway | 2003-12-16 18:44:49 | Re: functions returning sets |