Re: Patch to ALTER TABLE docs for 7.2.1

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
Cc: Justin Clift <justin(at)postgresql(dot)org>, pgsql-patches(at)postgresql(dot)org
Subject: Re: Patch to ALTER TABLE docs for 7.2.1
Date: 2002-02-18 02:00:03
Message-ID: 200202180200.g1I204X02955@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

> Christopher Kings-Lynne wrote:
> Another idea. Now that we have ALTER TABLE / ADD PRIMARY KEY - we should
> modify the pg_dump format to instead of doing this:
>
> CREATE TABLE food (
> a int4,
> PRIMARY KEY (a)
> );
>
> COPY FROM ...
>
> It should be like this:
>
> CREATE TABLE food (
> a int4
> );
>
> COPY FROM ...
>
> ALTER TABLE food ADD PRIMARY KEY (a);
>
> This will be a lot faster. The only reason (I believe) that it was not done
> like this previously is that it wasn't possible to recreate a PK in any
> other way without twiddling the catalogs.

Very good point. Added to TODO:

* Have pg_dump use ADD PRIMARY KEY after COPY, for performance

--
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 Justin Clift 2002-02-18 02:40:41 Re: [PATCHES] Patch to ALTER TABLE docs for 7.2.1
Previous Message Christopher Kings-Lynne 2002-02-18 01:34:14 Re: Patch to ALTER TABLE docs for 7.2.1

Browse pgsql-patches by date

  From Date Subject
Next Message Justin Clift 2002-02-18 02:40:41 Re: [PATCHES] Patch to ALTER TABLE docs for 7.2.1
Previous Message Christopher Kings-Lynne 2002-02-18 01:34:14 Re: Patch to ALTER TABLE docs for 7.2.1