pg_restore duplicate key violations

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: pg_restore duplicate key violations
Date: 2006-05-08 19:11:39
Message-ID: 1147115499l.18374l.3l@mofo
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

PostgreSQL 8.1.3, Centos 4.2

I'm having trouble with a dump and restore:

$ pg_dump --format=t --schema=babase --data-only --user babase_admin
babase_test | pg_restore --data-only --disable-triggers --user
babase_admin --dbname=babase
pg_restore: ERROR: duplicate key violates unique constraint
"activities_pkey"
CONTEXT: COPY activities, line 1: "B t t Be groomed"
pg_restore: [archiver (db)] error returned by PQendcopy: ERROR:
duplicate key violates unique constraint "activities_pkey"
CONTEXT: COPY activities, line 1: "B t t Be groomed"

The two databases/schemas are identical.

I bumped around the list archives and found a post that seemed
to indicate locale could be a problem. When I did an initdb
to initialize the cluster I made sure that the locale was C,
and all the LC_ options in postgresql.conf are shown
as C and "show all" shows them all as C in both databases.

The locale in my shell is all en_US.UTF-8 so I tried setting
LC_CHAR and LC_COLLATE to C in the shell before running
the dump/restore and this did not work. Likewise with LC_ALL.
I also tried exporting LC_CHAR and LC_COLLATE as C in
/etc/sysconfig/pgsql/postgresql so that the server would run
in the correct locale, just in case, but this did not work either.

If it matters when installing postgres I recompiled the
source rpm so as to make it an i686.

Where do I go from here?

Thanks.

Karl <kop(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

Responses

Browse pgsql-general by date

  From Date Subject
Next Message George Pavlov 2006-05-08 19:26:48 exporting quoted CSV data from a query
Previous Message Tom Lane 2006-05-08 18:08:43 Re: database size grows (even after vacuum (full and analyze))....