pg_dumping a table having a primary key yields commands like
--
-- TOC Entry ID 2 (OID 139812)
--
-- Name: table1 Type: TABLE Owner: postgres
--
CREATE TABLE "table1" ("column10" character varying(255) NOT NULL,"column1" character varying(255) NOT NULL,"column2"
smallintNOT NULL,"column6" numeric,"column7" "char",Constraint "table1_pkey" Primary Key ("column10", "column1",
"column2")
);
[snip]
--
-- TOC Entry ID 5 (OID 139817)
--
-- Name: "table1_pkey" Type: CONSTRAINT Owner: postgres
--
Alter Table "table1" Add Constraint "table1_pkey" Primary Key ("column10", "column1", "column2");
which on execution quite properly complains about duplicate primary
keys.
I assume this is traceable to this patch:
2002-03-06 15:48 momjian
* src/bin/pg_dump/pg_dump.c: Enable ALTER TABLE ADD PRIMARY KEY forpg_dump, for performance reasons so index is not on
tableduringCOPY.> > AFAICT, the patch I posted to -patches a little while to enablethe> > usage of ALTER TABLE ADD
PRIMARYKEY by pg_dump hasn't beenapplied, nor> > is it in the unapplied patches list. I was under the impressionthat> >
thiswas in the queue for application -- did it just get lost?Neil Conway <neilconway@rogers.com>
It would seem that more thought is needed here.
regards, tom lane