Re: Untitled

Поиск
Список
Период
Сортировка
От Erwin Moller
Тема Re: Untitled
Дата
Msg-id 3e81541b$0$49104$e4fe514c@news.xs4all.nl
обсуждение исходный текст
Ответ на ...  (Mukund Pate <patemukund@yahoo.com>)
Список pgsql-admin
Mukund Pate wrote:

> --0-762086988-1039675154=:50830
> Content-Type: text/plain; charset=us-ascii
>
>
> hello,
>
> how to modify the datatype of column in a table?
>
> i have created table with one coulmn datatype is varchar(200) so i  would
> like to change to text datatype
>

Hi,

Please take the time to fill in a subject next time you post.

To your question:
You cannot change the datatype in an existing table.
If you are using Postgres 7.3 (next time you post please give us some
backgroundinformation like your Postgresversion and OS) you can add a
column of the texttype to your table and give a simple SQL-command to
populate it. (UPDATE tblyourtable SET newcolumn=oldcolumn)

Then drop the old column.

If you are using triggers (Foreign keys for example) or indexes on the
column, you better think it over first and recreate them afterwards.

Regards,
Erwin
> thanks in advance
>
> mukund
>
>
>

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

Предыдущее
От: sdurand@insa-rouen.fr
Дата:
Сообщение: JSP ???
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Monitoring server loads