Re: ALTER TABLE & COLUMN - Mailing list pgsql-general

From Neil Conway
Subject Re: ALTER TABLE & COLUMN
Date
Msg-id 1038601326.10098.7.camel@tokyo
Whole thread Raw
In response to ALTER TABLE & COLUMN  (Çağıl Şeker <cagils@biznet.com.tr>)
Responses Re: ALTER TABLE & COLUMN  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Re: ALTER TABLE & COLUMN  (Tilo Schwarz <mail@tilo-schwarz.de>)
List pgsql-general
On Fri, 2002-11-29 at 11:05, Çağıl Şeker wrote:
> I am surprised by the fact that altering tables and columns is so
> limited in PostgreSQL, this powerful DBMS! Changing column types and
> droping columns are missing important features I think.

7.3 (released yesterday) supports DROP COLUMN, as well as a bunch of
other enhancements to ALTER TABLE.

As for changing the type of a column, how would this be anything more
than syntactic sugar over renaming the existing column to a temp name,
adding a new column with the appropriate type & name, moving the data
from the old column to the new one, and dropping the old one?

Since a lot of data type changes are not obvious (how do you convert the
data from one type to another, in all cases?), I don't see a real
problem leaving this in the hands of the admin. The one exception might
be changing the length limit on a varchar(n) column, but that's such a
small case I'm not sure it's worth the bother (and can be done by
hacking the system catalogs anyway).

Cheers,

Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC




pgsql-general by date:

Previous
From: Scott Lamb
Date:
Subject: Re: SQL Query
Next
From: Hubert depesz Lubaczewski
Date:
Subject: strange pg_stats behaviour?