Re: pg_dump / Unique constraints

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Pgsql-Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_dump / Unique constraints
Date: 2000-11-22 15:50:00
Message-ID: 200011221550.KAA18441@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> At 16:33 22/11/00 +0800, Christopher Kings-Lynne wrote:
> >At 15:50 22/11/00 +0800, Christopher Kings-Lynne wrote:
> >> >I've been examining the pg_dump source and output, and I've come to the
> >> >conclusion that I can modify it so that UNIQUE constraints
> >> appear as part of
> >> >the CREATE TABLE statement, rather than as a separate CREATE INDEX.
> >> ...
> >> >Is there any problem with me working on this?
> >>
> >> I actually don't think it's a good idea to force things to work that way.
> >
> >Why, exactly?
>
> Having now looked at the code and seen that PK constraints are already
> dumped in the table definition, I guess doing unique constraints in the
> same way is no worse.

I have a good reason not to use UNIQUE. As I remember, pg_dump creates
the tables, copies in the data, then creates the indexes. This is much
faster than doing the copy with the indexes already created.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2000-11-22 16:08:41 Re: Crash during WAL recovery?
Previous Message Thomas Lockhart 2000-11-22 15:31:00 Re: Crash during WAL recovery?