Re: pg_dump / Unique constraints - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: pg_dump / Unique constraints
Date
Msg-id 200011221550.KAA18441@candle.pha.pa.us
Whole thread Raw
In response to RE: pg_dump / Unique constraints  (Philip Warner <pjw@rhyme.com.au>)
Responses Re: pg_dump / Unique constraints  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: Crash during WAL recovery?
Next
From: Hannu Krosing
Date:
Subject: Re: Crash during WAL recovery?