473,503 Members | 4,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB with bytea types reload problem

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
1 1935
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2855
by: mPath Records | last post by:
Hello, I hope someone can help me with this problem - I'm getting nowhere fast and have been working on it for a week. All I'm trying to do is upload an image, store the image in a bytea...
48
11809
by: Edwin Quijada | last post by:
Hi !! Everybody I am developing app using Delphi and I have a question: I have to save pictures into my database. Each picture has 20 o 30k aprox. What is the way more optimus? That 's table will...
2
21810
by: Alvar Freude | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I want to change a column from text to bytea; since it seems that alter table can't change the column type, i have to add a temporary column...
32
3814
by: David Garamond | last post by:
Are there any drawbacks of using BYTEA for PK compared to using a primitive/atomic data types like INT/SERIAL? (like significant performance hit, peculiar FK behaviour, etc). I plan to use BYTEA...
4
3628
by: David Garamond | last post by:
May I request that connectby() supports BYTEA keys too? My keys are GUID (16-byte stored in BYTEA). In this case, branch_delim does not make sense because the keys should be fixed-length anyway,...
2
2647
by: Carlos | last post by:
Do I need to use the -b option in pg_dump to dump bytea fields? For a while now I have been routinely using the -b option in pg_dump to back up, restore, and copy my databases because I thought...
7
4435
by: Dennis Gearon | last post by:
when bytea, text, and varchar(no limit entered) columns are used, do they ALWAYS use an extra table/file? Or do they only do it after a certain size of input? Also, if I wanted to put a *.pdf...
4
11406
by: Jerry LeVan | last post by:
Hi, I am adding image and large object support in my Cocoa postgresql browser. Are there going to be any enhanced bytea support functions coming along? It seems sorta silly to have to write...
4
4460
by: Együd Csaba | last post by:
Hi, the restoration of a dump stops at the line above. The dump was created with pgsql 7.3.2 and I need to pump it into a 7.4.3 one. Should anybody tell me what the problem can be and how I can...
0
7193
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7316
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6975
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7449
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5562
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4992
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3160
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1495
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
371
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.