Re: Changing Column Type

Поиск
Список
Период
Сортировка
От Kevin Brannen
Тема Re: Changing Column Type
Дата
Msg-id 3D7E4D5A.3040008@nurseamerica.net
обсуждение исходный текст
Ответ на Changing Column Type  (Peter Atkins <peter.atkins@NXCD.com>)
Список pgsql-sql
Peter Atkins wrote:
> All,
> 
> Is there a way to easily change the type of  column? Or do I have to drop
> and create again.
> 
> From:
> assignment_notes | character varying(255)
> 
> To:
> assignment_notes | text

Do that kind of change will require creating a new table, copying the 
data, dropping the old table, renaming the new to the old.

If you were changing from varchar(20) to varchar(255), you could hack 
the system tables and be OK (or so I've read).  Going smaller is 
possible too, as long as your 110% sure you don't have any data bigger 
then the new smaller size (or you're taking your life into your own 
hands so to speak. :-)

HTH,
Kevin



В списке pgsql-sql по дате отправления:

Предыдущее
От: "Michael Paesold"
Дата:
Сообщение: Re: Rules and Triggers
Следующее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: Rules and Triggers