Re: Patch to ALTER TABLE docs for 7.2.1
| От | Bruce Momjian |
|---|---|
| Тема | Re: Patch to ALTER TABLE docs for 7.2.1 |
| Дата | |
| Msg-id | 200202180200.g1I204X02955@candle.pha.pa.us обсуждение исходный текст |
| Ответ на | Re: Patch to ALTER TABLE docs for 7.2.1 ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>) |
| Ответы |
Re: Patch to ALTER TABLE docs for 7.2.1
|
| Список | 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@candle.pha.pa.us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026
В списке pgsql-patches по дате отправления: