X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 13F82D1BC54 for ; Mon, 1 Dec 2003 13:39:56 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 03122-05 for ; Mon, 1 Dec 2003 09:39:28 -0400 (AST) Received: from anchor-post-34.mail.demon.net (anchor-post-34.mail.demon.net [194.217.242.92]) by svr1.postgresql.org (Postfix) with ESMTP id 2FFF0D1B446 for ; Mon, 1 Dec 2003 09:39:24 -0400 (AST) Received: from lfix.demon.co.uk ([80.177.205.209] helo=cerberus.lfix.co.uk) by anchor-post-34.mail.demon.net with esmtp (Exim 3.35 #1) id 1AQoGt-000Del-0Y; Mon, 01 Dec 2003 13:39:27 +0000 Received: from linda.lfix.co.uk ([192.168.1.1]) by cerberus.lfix.co.uk with esmtp (Exim 4.24) id 1AQoGn-000849-AP; Mon, 01 Dec 2003 13:39:21 +0000 Subject: Re: db-recovery after update 7.1 -> 7.4 failed From: Oliver Elphick To: Dominique Fenenr Cc: pgsql-admin@postgresql.org In-Reply-To: References: Content-Type: text/plain Organization: LFIX Limited Message-Id: <1070285931.7719.2667.camel@linda.lfix.co.uk> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.5 Date: Mon, 01 Dec 2003 13:38:51 +0000 Content-Transfer-Encoding: 7bit X-LFIX-MailScanner: Found to be clean X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/7 X-Sequence-Number: 11515 On Mon, 2003-12-01 at 09:35, Dominique Fenenr wrote: > Hi all, > > I recently upgraded postgresql from 7.1 to 7.4. I did a > > pg_dumpall > backup > > then installed the new version and tried to recover my data with > > psql template1 > But something went wrong. The log shows the following: ... > NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index > "phpbb_words_pkey" for table "phpbb_words" > ERROR: invalid input syntax for integer: " > " > CONTEXT: COPY phpbb_posts_text, line 2, column post_id: " > " ... > NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index > "netjuke_plists_fav_pkey" for table "netjuke_plists_fav" > ERROR: literal carriage return found in data > HINT: Use "\r" to represent carriage return. > CONTEXT: COPY netjuke_tracks, line 3312: "3196 940 335 4 > 21 Things I Want In A Lover 4991999 > 207 1 2002 2003-05-16 21:24:08+02 192 44100 > MPEG ..." > > "phpbb_posts_text" and "netjuke_tracks" don't have no rows anymore which > is pretty bad. I had a look at the backup-file, the data is still > there. Do I have any chance to recover the data? Perhaps by > manipulating the backup file? Eidt the backup file first (since you have the line numbers in it) to correct the errors. Then extract the two sets of data for those two files and the associated COPY commands to a separate file and import it in just the same way as you did the whole backup. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "Who is like unto thee, O LORD, among the gods? who is like thee, glorious in holiness, fearful in praises, doing wonders?" Exodus 15:11