Re: Changing column data type on an existing table

Поиск
Список
Период
Сортировка
От Bricklen Anderson
Тема Re: Changing column data type on an existing table
Дата
Msg-id 4284EE2F.5020502@PresiNET.com
обсуждение исходный текст
Ответ на Re: Changing column data type on an existing table  (Brad Nicholson <bnichols@ca.afilias.info>)
Список pgsql-general
> Joe Audette wrote:
>
> Hi,
>
> I have an app that I released with a particular field
> as varchar 255.
>
> Can someone give me a script example I can use to make
> an upgrade script to change it to text or at least to
> larger varchar without losing existing data?
>
> I support 3 different dbs in my app, Postgre is the
> newest and least familiar to me but I am trying to
> learn.
>
> Any help much appreciated.
>
> Joe Audette

In v8 at least, you can issue:
alter TABLE <tablename> ALTER <column_name> TYPE text;


--
_______________________________

This e-mail may be privileged and/or confidential, and the sender does
not waive any related rights and obligations. Any distribution, use or
copying of this e-mail or the information it contains by other than an
intended recipient is unauthorized. If you received this e-mail in
error, please advise me (by return e-mail or otherwise) immediately.
_______________________________

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

Предыдущее
От: Brad Nicholson
Дата:
Сообщение: Re: Changing column data type on an existing table
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: WHERE