Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 3D89B9FA2EE; Tue, 2 Jan 2007 06:00:54 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-new, port 10024) with ESMTP id 92689-04; Tue, 2 Jan 2007 06:00:41 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.metronet.co.uk (mail.metronet.co.uk [213.162.97.75]) by postgresql.org (Postfix) with ESMTP id 78C6D9F938C; Tue, 2 Jan 2007 06:00:41 -0400 (AST) Received: from mainbox.archonet.com (84-51-143-99.archon037.adsl.metronet.co.uk [84.51.143.99]) by smtp.metronet.co.uk (MetroNet Mail) with ESMTP id 4E2BE751BE; Tue, 2 Jan 2007 10:00:40 +0000 (GMT) Received: from [192.168.1.17] (client17.office.archonet.com [192.168.1.17]) by mainbox.archonet.com (Postfix) with ESMTP id 09DE1FF04; Tue, 2 Jan 2007 10:00:39 +0000 (GMT) Message-ID: <459A2D47.4020206@archonet.com> Date: Tue, 02 Jan 2007 10:00:39 +0000 From: Richard Huxton User-Agent: Thunderbird 1.5.0.8 (X11/20061115) MIME-Version: 1.0 To: Bob Pawley Cc: Dave Page , Shoaib Mir , Postgresql Subject: Re: Backup Restore References: <000e01c72ab1$ceec0220$8e904618@owner> <45941B3B.8060708@postgresql.org> <002601c72ab8$97bc5640$8e904618@owner> <459423C1.70009@postgresql.org> <006001c72aec$2789cfe0$8e904618@owner> <4594CD6D.1050104@postgresql.org> <001001c72b7a$ba2e7600$8e904618@owner> <4595650F.7000504@postgresql.org> <001901c72b7f$5a5e29f0$8e904618@owner> In-Reply-To: <001901c72b7f$5a5e29f0$8e904618@owner> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200701/26 X-Sequence-Number: 106566 Bob Pawley wrote: > Following is the error message on pg_restore:- > > "pg_restore: ERROR: duplicate key violates unique constraint > "spatial_ref_sys_pkey" > CONTEXT: COPY spatial_ref_sys, line 1: "2000 EPSG 2000 PROJCS["Anguilla > 1957 / British West Indies Grid",GEOGCS["Anguilla 1957",DATUM["Angui..." > pg_restore: [archiver (db)] error returned by PQendcopy: ERROR: > duplicate key violates unique constraint "spatial_ref_sys_pkey" > CONTEXT: COPY spatial_ref_sys, line 1: "2000 EPSG 2000 PROJCS["Anguilla > 1957 / British West Indies Grid",GEOGCS["Anguilla 1957",DATUM["Angui..." > pg_restore: *** aborted because of error > > Process returned exit code 1." > > The GIS feature was removed from the PostgreSQL application before the > project dump. Not sure what you mean by that - you removed all GIS related types and functions from the source database? > Anyone have any thoughts on how to get around this?? Remove the constraint if you no longer have that requirement. It looks like you have a primary-key defined on spatial_ref_sys and want to remove it. See the SQL Reference section of the manuals for how to use ALTER TABLE to drop primary keys and other constraints. I'm curious as to how this can happen though. Are the definitions of table spatial_ref_sys the same in the source and target database? -- Richard Huxton Archonet Ltd