Re: ALTER TABLE & COLUMN

Поиск
Список
Период
Сортировка
Искать
От
Neil Conway
Тема
Re: ALTER TABLE & COLUMN
Дата
Msg-id
1038601326.10098.7.camel@tokyo
Ответ на
ALTER TABLE & COLUMN (Çağıl Şeker)
Список
Дерево обсуждения
Re: ALTER TABLE & COLUMN Vivek Khera <khera@kcilink.com>
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  || PGP Key ID: DB3C29FC



В списке pgsql-general по дате отправления
От: Scott Lamb
Дата:
Сообщение: Re: SQL Query
От: Hubert depesz Lubaczewski
Дата:
Сообщение: strange pg_stats behaviour?
FAQ