Re: ALTER TABLE modifications

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Rod Taylor <pg(at)rbt(dot)ca>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: ALTER TABLE modifications
Date: 2003-11-13 11:28:19
Message-ID: 1068722899.4751.16.camel@fuji.krosing.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Peter Eisentraut kirjutas K, 12.11.2003 kell 21:02:
> Rod Taylor writes:
>
> > ALTER TABLE tab ADD COLUMN col DEFAULT 3, ADD CHECK (anothercol > 3);
> > The above combinational syntax is commented out in gram.y. The
> > support framework is used in both the above and below items, but
> > arbitrary statements probably have some issues -- I've not
> > tested enough to determine.
> >
> > If it is useful, it will be submitted at a later date.
>
> I think it's perfectly fine to write two separate ALTER TABLE statements.

I guess the difference is that each pass (i.e. ALTER TABLE) needs to do
another scan and copy of the table. Putting them in one statement allows
all the alterations to be done in one pass.

> No need to introduce this nonstandard syntax.
>
> > ALTER TABLE tab ALTER COLUMN col TYPE text TRANSFORM ...;
> > Currently migrates indexes, check constraints, defaults, and the
> > column definition to the new type with optional transform. If
> > the tranform is not supplied, a standard assignment cast is
> > attempted.
>
> Please don't use the term "transform". It is used by the SQL standard for
> other purposes.

Is the "other" use conflicting with this syntax ?

I think we have preferred reusing existing keywords to adding new ones
in the past.

-----------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marc G. Fournier 2003-11-13 12:36:41 Re: rpm support for 7.4 and beyond
Previous Message Lamar Owen 2003-11-13 11:19:04 Re: rpm support for 7.4 and beyond

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2003-11-13 13:14:27 Re: [PATCHES] initdb in C
Previous Message Andrew Dunstan 2003-11-13 04:51:04 Re: [PATCHES] initdb in C