Re: pg_dump is broken in CVS tip

From: Neil Conway <neilconway(at)rogers(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgman(at)candle(dot)pha(dot)pa(dot)us, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: pg_dump is broken in CVS tip
Date: 2002-04-12 22:44:17
Message-ID: 20020412184417.62eeb74e.neilconway@rogers.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 12 Apr 2002 13:28:34 -0400
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> 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" smallint NOT 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.

Thanks for finding this Tom -- my apologies, this is likely my bug.

However, when I created a table using the commands above and then
dumped it again, I got a dump that worked properly: there was no
Constraint within the table definition itself, just an ALTER
TABLE at the end of the dump to add the PK (i.e. the patch worked
as intended and the table could be restored properly).

If you can give me a reproduceable test-case, I'll fix the bug.

Cheers,

Neil

--
Neil Conway <neilconway(at)rogers(dot)com>
PGP Key ID: DB3C29FC

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2002-04-12 22:48:51 Re: numeric/decimal docs bug?
Previous Message Thomas Lockhart 2002-04-12 22:33:42 Re: numeric/decimal docs bug?