[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-general
Subject:    Re: [GENERAL] pg_dump and errors
From:       Ben-Nes Michael <miki () canaan ! co ! il>
Date:       2004-05-31 15:11:58
Message-ID: 016a01c44721$9e20f770$0600000a () mikislap
[Download RAW message or body]

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
  --------------------------


[Attachment #3 (text/html)]

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1255">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Here some more information:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Versions:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>the pg_dump used&nbsp;is 7.4.2 ( under debian 
)</FONT></DIV>
<DIV><FONT face=Arial size=2>the Server im getting the DB from is 
7.3.2</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I did:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>pg_dump -h www -U postgres db_name &gt; 
20040531-db_name.dump</FONT></DIV>
<DIV><FONT face=Arial size=2>psql db_name &lt; 
20040531-db_name.dump</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>got this alot. is this an Error ?</FONT></DIV>
<DIV><FONT face=Arial size=2>Query buffer reset (cleared).</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>On runing the psql two files created in the working 
directory, something like ( i was able to delete them using MC ):</FONT></DIV>
<DIV><FONT face=Arial 
size=2>?\012\301\006,B\0360@\006\330\000\021?@\004?\000.................</FONT></DIV>
<DIV><FONT face=Arial size=2>and</FONT></DIV>
<DIV><FONT face=Arial size=2>C?F\004</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The following error accour becouse 7.3 was compiled 
by me under RH on a specific path, the current version use other 
paths.</FONT></DIV>
<DIV><FONT face=Arial size=2>ERROR:&nbsp; could not access file 
"/usr/local/pgsql7.3/lib/plpgsql.so": No such file or directory<BR>ERROR:&nbsp; 
function plpgsql_call_handler() does not exist</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>if I use createlang before the dump i just 
get:</FONT></DIV>
<DIV><FONT face=Arial size=2>ERROR:&nbsp; function "plpgsql_call_handler" 
already exists with same argument types<BR>ERROR:&nbsp; language "plpgsql" 
already exists</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The next error is strange, the relation ( table ) 
exist as create in the dump file, maybe its and order issue ?</FONT></DIV>
<DIV><FONT face=Arial size=2>ERROR:&nbsp; relation "forum_tree" does not 
exist</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>The next one is realy strange. the relation 
forum_tree2 exists in one of the development phase, it was deleted long time 
ago:</FONT></DIV>
<DIV><FONT face=Arial size=2>ERROR:&nbsp; relation "forum_tree2_node_id_seq" 
does not exist</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>lots of:</FONT></DIV>
<DIV><FONT face=Arial size=2>invalid command 
\n&lt;F0&gt;&lt;E5&gt;&lt;F9&gt;&lt;E0&gt;&lt;E9&gt;</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>save as the error for forum_tree:</FONT></DIV>
<DIV><FONT face=Arial size=2>ERROR:&nbsp; relation "forum_files" does not 
exist</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>same as the error for 
forum_tree2_node_id_seq</FONT></DIV>
<DIV><FONT face=Arial size=2>ERROR:&nbsp; relation "forum_files2_file_id_seq" 
does not exist</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I found a way to move it to 7.4.2 but its kinda 
pain.</FONT></DIV>
<DIV><FONT face=Arial size=2>I recreated all the scheme using my&nbsp;source 
code. then after edit the dump file by hand ( fixing the strange forum_tree2 
relations )&nbsp;dumping all the data into using Insert.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Am i doing something wrong ?</FONT></DIV>
<DIV>--------------------------<BR>Canaan Surfing Ltd.<BR>Internet Service 
Providers<BR>Ben-Nes Michael - Manager<BR>Tel: 972-4-6991122<BR>Fax: 
972-4-6990098<BR><A 
href="http://www.canaan.net.il">http://www.canaan.net.il</A><BR>--------------------------<BR></DIV>
 <BLOCKQUOTE dir=ltr 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 \
2px solid; MARGIN-RIGHT: 0px">  <DIV style="FONT: 10pt arial">----- Original Message \
----- </DIV>  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=miki@canaan.co.il href="mailto:miki@canaan.co.il">Ben-Nes Michael</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=pgsql-general@postgresql.org 
  href="mailto:pgsql-general@postgresql.org">postgresql</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, May 31, 2004 1:49 PM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [GENERAL] pg_dump and 
  errors</DIV>
  <DIV><BR></DIV>
  <DIV><FONT face=Arial size=2>Hello</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Im getting strange errors when restoring data 
  from pg_dump files:</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>ERROR:&nbsp; duplicate key violates unique 
  constraint "products_pkey"<BR>CONTEXT:&nbsp; COPY products, line 1: 
  "98&nbsp;&nbsp;&nbsp; Super Pak Ruby 
  j&amp;aacute;t&amp;eacute;k&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; J-0001&nbsp; 
  1502450E&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Szuper Pok&amp;eacute;mon 
  aj&amp;aacute;nd&amp;eacute;kcso..."<BR>ERROR:&nbsp; duplicate key violates 
  unique constraint "attributes_pkey"<BR>CONTEXT:&nbsp; COPY attributes, line 1: 
  "2&nbsp;&nbsp; Width"<BR>ERROR:&nbsp; duplicate key violates unique constraint 
  "prod_attributes_pkey"<BR>CONTEXT:&nbsp; COPY prod_attributes, line 1: 
  "1038&nbsp;&nbsp; 23&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  12&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "<BR>ERROR:&nbsp; duplicate key violates 
  unique constraint "prod_images_pkey"<BR>CONTEXT:&nbsp; COPY prod_images, line 
  1: "73 14&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A 
  href="file://\\377\\330\\377\\340\\000\\020JFIF\\000\\001\\001\\001\\000H\\000H\\000 \
\\000\\377\\333\\000C\\">\\377\\330\\377\\340\\000\\020JFIF\\000\\001\\001\\001\\000H\\000H\\000\\000\\377\\333\\000C\\</A>..."<BR>ERROR:&nbsp; \
  duplicate key violates unique constraint 
  "manufacturer_images_pkey"<BR>CONTEXT:&nbsp; COPY manufacturer_images, line 1: 
  "296&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
  81&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A 
  href="file://\\377\\330\\377\\340\\000\\020JFIF\\000\\001\\001\\001\\000H\\000H\\000 \
\\000\\377\\376\\000&amp;F">\\377\\330\\377\\340\\000\\020JFIF\\000\\001\\001\\001\\000H\\000H\\000\\000\\377\\376\\000&amp;F</A>..."</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Im using pg 7.4.1 on woody ( debian 
  ).</FONT></DIV>
  <DIV><FONT face=Arial size=2>this is not the first time such hapens and i have 
  a constant fear from backup failures.</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>once I even&nbsp;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 )</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>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 )</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>/usr/bin/pg_dump -s -f /var/pg_dumps/db1 
  db1</FONT></DIV>
  <DIV><FONT face=Arial size=2>/usr/bin/pg_dump -a -f /var/pg_dumps/db1 
  db1</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Any ideas how to avoid such errors ( if possible 
  at all ) ?</FONT></DIV>
  <DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
  <DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
  <DIV><FONT face=Arial size=2>--------------------------<BR>Canaan Surfing 
  Ltd.<BR>Internet Service Providers<BR>Ben-Nes Michael - Manager<BR>Tel: 
  972-4-6991122<BR>Fax: 972-4-6990098<BR><A 
  href="http://www.canaan.net.il">http://www.canaan.net.il</A><BR>--------------------------<BR></FONT></DIV></BLOCKQUOTE></BODY></HTML>




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic