Re: ALTER TABLE TODO items - Mailing list pgsql-hackers

From Zeugswetter Andreas SB SD
Subject Re: ALTER TABLE TODO items
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA40184D0C4@m0114.s-mxs.net
Whole thread Raw
In response to ALTER TABLE TODO items  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
> FireBird: ALTER COLUMN <column> TYPE <type>
> DB2:    ALTER COLUMN <column> SET DATA TYPE <type>.
> Oracle:    MODIFY <column> <type>
> MSSQL:    ALTER COLUMN <column> <type> <constraints>
> MySQL:    Both Oracle and MSSQL
> Sap:    MODIFY <column> <type>
>
> Spec:    Nothing (obvious) on changing column types
>
> MODIFY is horrible. It seems to drop all constraints, defaults, etc that
> are not specified in the second definition. It is essentially a
> replacement of the column.

In Oracle MODIFY leaves omitted parts unchanged,
syntax is actually ALTER TABLE <table> MODIFY (<column> <type> <default> <constraint>)
I think the parentheses are optional if only one column is modified.

Andreas


pgsql-hackers by date:

Previous
From: Gaetano Mendola
Date:
Subject: Constraint not shown on \d ?
Next
From: "Andrew Dunstan"
Date:
Subject: Re: Is there any method to keep table in memory at startup