By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,541 Members | 1,427 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,541 IT Pros & Developers. It's quick & easy.

DB with bytea types reload problem

P: n/a
I am using 7.3.2

I've made a mistake and saved a database like this

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

....instead of using a binary output format, which I guess I need. I
can't reload the db due to some thumbnail images which are stored as
bytea.

psql: \i out.sql

Causes multiple errors, 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\\00 0\\000MM\\000*\\000\\000\\000\\010\\000\\012\\00.. ..

Is there any way I can retrieve the image data?

Thanks,
Rory
--
Rory Campbell-Lange
<ro**@campbell-lange.net>
<www.campbell-lange.net>

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Nov 12 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rory Campbell-Lange wrote:
pg_dump -a -d <db> > out.sql
From this:
The sql dump file has lines starting something like this for the photo
table:
1 500 375 h \\377\\330\\377\\340...


it doesn't look to me like you actually ran that command. The -d says
you should have INSERT statements, but you seem to have copy out data.
Try doing:

COPY tablename FROM 'out.sql';

or some variation thereof.

Joe

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.