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

From Rod Taylor
Subject Re: ALTER TABLE TODO items
Date
Msg-id 1083900068.22610.114.camel@jester
Whole thread Raw
In response to Re: ALTER TABLE TODO items  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: ALTER TABLE TODO items  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> > Also, should the syntax be SET TYPE, not just TYPE?
> 
> Shrug ... I dunno whether Rod had a precedent for that choice or not.

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.

FireBird is the closest to our implementation. DB2 only allows changing
the length of a VARCHAR and even then it is restrictive in the amount
the length can change by.

I remember polling -hackers to see if there were objections at the time,
but the syntax is easy enough to change if you wish.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: psql 7.3.4 disagrees with NATURAL CROSS JOIN
Next
From: Tom Lane
Date:
Subject: Re: ALTER TABLE TODO items