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

From Jonathan Bartlett
Subject Re: Reload bytea [was Re: Picture with Postgres and Delphi]
Date
Msg-id Pine.GSU.4.44.0312161056200.6919-100000@eskimo.com
Whole thread Raw
In response to Reload bytea [was Re: Picture with Postgres and Delphi]  (Rory Campbell-Lange <rory@campbell-lange.net>)
List 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@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: Joe Conway
Date:
Subject: Re: functions returning sets
Next
From: Paul Ganainm
Date:
Subject: Re: add column sillyness