Re: Howto change column length

Поиск
Список
Период
Сортировка
От bpalmer
Тема Re: Howto change column length
Дата
Msg-id Pine.BSO.4.33.0111061147140.8406-100000@mizer.crimelabs.net
обсуждение исходный текст
Ответ на Howto change column length  ("DC" <danc@bspmail.com>)
Ответы Re: Howto change column length
Список pgsql-general
> I have a column (ie name varchar(10))
> and I want to alter it to varchar(20)
> I've looked throught the docementation and web for examples (no luck),
> can anyone help?

That can't be done.  Once the datatype has been set,  it can't be changed
(how would changing it from 20 to 10 work?  how about from varchar to int,
etc).  With the limitation of not being able to drop a column yet,  you
would need to create the new table and copy all the data from one to the
other.

- Brandon

----------------------------------------------------------------------------
 c: 646-456-5455                                            h: 201-798-4983
 b. palmer,  bpalmer@crimelabs.net           pgp:crimelabs.net/bpalmer.pgp5



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

Предыдущее
От: Jeff Eckermann
Дата:
Сообщение: Re: copy command with PSQL
Следующее
От: Mark Nickel
Дата:
Сообщение: Re: copy command with PSQL