Re: ALTER TABLE TODO items

From: Rod Taylor <pg(at)rbt(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Merlin Moncure <merlin(dot)moncure(at)rcsonline(dot)com>, PostgreSQL Development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ALTER TABLE TODO items
Date: 2004-05-07 03:21:08
Message-ID: 1083900068.22610.114.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-05-07 03:25:04 Re: ALTER TABLE TODO items
Previous Message Tom Lane 2004-05-07 03:08:55 Re: psql 7.3.4 disagrees with NATURAL CROSS JOIN