473,323 Members | 1,551 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,323 software developers and data experts.

pg_dump and errors

Hello

Im getting strange errors when restoring data from pg_dump files:

ERROR: duplicate key violates unique constraint "products_pkey"
CONTEXT: COPY products, line 1: "98 Super Pak Ruby játék J-0001 1502450E Szuper Pokémon ajándékcso..."
ERROR: duplicate key violates unique constraint "attributes_pkey"
CONTEXT: COPY attributes, line 1: "2 Width"
ERROR: duplicate key violates unique constraint "prod_attributes_pkey"
CONTEXT: COPY prod_attributes, line 1: "1038 23 12 "
ERROR: duplicate key violates unique constraint "prod_images_pkey"
CONTEXT: COPY prod_images, line 1: "73 14 \\377\\330\\377\\340\\000\\020JFIF\\000\\001\\001\ \001\\000H\\000H\\000\\000\\377\\333\\000C\\..."
ERROR: duplicate key violates unique constraint "manufacturer_images_pkey"
CONTEXT: COPY manufacturer_images, line 1: "296 81 \\377\\330\\377\\340\\000\\020JFIF\\000\\001\\001\ \001\\000H\\000H\\000\\000\\377\\376\\000&F..."

Im using pg 7.4.1 on woody ( debian ).
this is not the first time such hapens and i have a constant fear from backup failures.

once I even had to move a db from 7.3 to 7.4 and pg_dump returned me some errors on not existing tables ( ones which i deleted before )

this is the line i use ( i started to seperate the scheme from the data becouse its easier to me to edit the files if something happens )

/usr/bin/pg_dump -s -f /var/pg_dumps/db1 db1
/usr/bin/pg_dump -a -f /var/pg_dumps/db1 db1

Any ideas how to avoid such errors ( if possible at all ) ?

Thanks
--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
Fax: 972-4-6990098
http://www.canaan.net.il
--------------------------

Nov 23 '05 #1
1 3237
Here some more information:

Versions:

the pg_dump used is 7.4.2 ( under debian )
the Server im getting the DB from is 7.3.2

I did:

pg_dump -h www -U postgres db_name > 20040531-db_name.dump
psql db_name < 20040531-db_name.dump

got this alot. is this an Error ?
Query buffer reset (cleared).

On runing the psql two files created in the working directory, something like ( i was able to delete them using MC ):
?\012\301\006,B\0360@\006\330\000\021?@\004?\000.. ...............
and
C?F\004

The following error accour becouse 7.3 was compiled by me under RH on a specific path, the current version use other paths.
ERROR: could not access file "/usr/local/pgsql7.3/lib/plpgsql.so": No such file or directory
ERROR: function plpgsql_call_handler() does not exist

if I use createlang before the dump i just get:
ERROR: function "plpgsql_call_handler" already exists with same argument types
ERROR: language "plpgsql" already exists

The next error is strange, the relation ( table ) exist as create in the dump file, maybe its and order issue ?
ERROR: relation "forum_tree" does not exist

The next one is realy strange. the relation forum_tree2 exists in one of the development phase, it was deleted long time ago:
ERROR: relation "forum_tree2_node_id_seq" does not exist

lots of:
invalid command \n<F0><E5><F9><E0><E9>

save as the error for forum_tree:
ERROR: relation "forum_files" does not exist

same as the error for forum_tree2_node_id_seq
ERROR: relation "forum_files2_file_id_seq" does not exist

I found a way to move it to 7.4.2 but its kinda pain.
I recreated all the scheme using my source code. then after edit the dump file by hand ( fixing the strange forum_tree2 relations ) dumping all the data into using Insert.

Am i doing something wrong ?
--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
Fax: 972-4-6990098
http://www.canaan.net.il
--------------------------

----- Original Message -----
From: Ben-Nes Michael
To: postgresql
Sent: Monday, May 31, 2004 1:49 PM
Subject: [GENERAL] pg_dump and errors
Hello

Im getting strange errors when restoring data from pg_dump files:

ERROR: duplicate key violates unique constraint "products_pkey"
CONTEXT: COPY products, line 1: "98 Super Pak Ruby j&aacute;t&eacute;k J-0001 1502450E Szuper Pok&eacute;mon aj&aacute;nd&eacute;kcso..."
ERROR: duplicate key violates unique constraint "attributes_pkey"
CONTEXT: COPY attributes, line 1: "2 Width"
ERROR: duplicate key violates unique constraint "prod_attributes_pkey"
CONTEXT: COPY prod_attributes, line 1: "1038 23 12 "
ERROR: duplicate key violates unique constraint "prod_images_pkey"
CONTEXT: COPY prod_images, line 1: "73 14 \\377\\330\\377\\340\\000\\020JFIF\\000\\001\\001\ \001\\000H\\000H\\000\\000\\377\\333\\000C\\..."
ERROR: duplicate key violates unique constraint "manufacturer_images_pkey"
CONTEXT: COPY manufacturer_images, line 1: "296 81 \\377\\330\\377\\340\\000\\020JFIF\\000\\001\\001\ \001\\000H\\000H\\000\\000\\377\\376\\000&F..."

Im using pg 7.4.1 on woody ( debian ).
this is not the first time such hapens and i have a constant fear from backup failures.

once I even had to move a db from 7.3 to 7.4 and pg_dump returned me some errors on not existing tables ( ones which i deleted before )

this is the line i use ( i started to seperate the scheme from the data becouse its easier to me to edit the files if something happens )

/usr/bin/pg_dump -s -f /var/pg_dumps/db1 db1
/usr/bin/pg_dump -a -f /var/pg_dumps/db1 db1

Any ideas how to avoid such errors ( if possible at all ) ?

Thanks
--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
Fax: 972-4-6990098
http://www.canaan.net.il
--------------------------

Nov 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Sam | last post by:
I'm having trouble restoring databases that have to lo type installed in /contrib/lo. The dump seems to work just fine, I get no errors when I execute the following command #pg_dump -Fc -o -b...
7
by: Ed L. | last post by:
We are seeing what looks like pgsql data file corruption across multiple clusters on a RAID5 partition on a single redhat linux 2.4 server running 7.3.4. System has ~20 clusters installed with a...
0
by: Aienthiwan | last post by:
Hello all, I'm running a debian server and recently updated my version of PostgreSQL to "unstable", that being v7.4.1. I had no trouble at all getting everything up to date and going. But my...
4
by: jack turer | last post by:
I have a database in pgsql (7.3.2) on redhat 9. When I try a 'pg_dump mydb' to back up the database, I get: pg_dump: could not find namespace with OID 2200 Verbose version is: -bash-2.05b$...
9
by: Alexander Cohen | last post by:
(sorry for the double post if there is one - i sent the mail to the lisyt from the wrong address) Hi, Im passing this in the commmand line to start up the PostgreSQL server: ../pg_ctl start...
4
by: Philip | last post by:
I'm rather new to database stuff. I've been using postgresql for a couple years, but that doesn't mean I understand what I'm doing. I have simply followed the "HOW-TOs". But now I think I'm about...
6
by: Michal Hlavac | last post by:
Hellou, when I use pg_dump database > dump.dat on database with tsearch2 and then psql database < dump.dat - this command fails, because in dump.dat is declaration of tsearch2 procedures and...
0
by: David Suela Fernández | last post by:
Hi! I have a debian woody with postgresql 7.4.2. When i try to use pg_dump i get the next error: pg_dump: saving encoding pg_dump: saving database definition pg_dump: SQL command failed...
6
by: Ilia Chipitsine | last post by:
Dear Sirs, I want to dump all databases, but separately each database in its own file, not all databases in one single file as pg_dumpall does. How can I implement that ? Cheers, Ilia...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.