Re: changing the size of a column without losing data

Поиск
Список
Период
Сортировка
От AarniRuuhimäki / Megative Tmi / KYMI.com
Тема Re: changing the size of a column without losing data
Дата
Msg-id 20020823075428.FSVT26596.fep08.tmt.tele.fi@there
обсуждение исходный текст
Ответ на changing the size of a column without losing data  ("Mark Seftel" <mark@trustemail.com>)
Список pgsql-novice
Hi !

One quick way to do this is to take a dump from your x_db. Edit the dump file
and change your field's defition from character varying(100) to character
varying (50)

Make sure the data is valid for this shorter field. Drop your x_db. Create a
new empty x_db. Read the dump in the new x_db.

BR,

aarni



On Thursday 22 August 2002 08:43 pm, you wrote:
> hi,
>
> How would i change a field which is currently char100 to char50?
>
> have tried:
> ALTER TABLE outlets MODIFY description varchar(50);
>
> but get error:
> parser: parse error at or near "modify"
>
> what is the correct command.
>
> Thx
>
> Mark
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


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

Предыдущее
От: "paul butler"
Дата:
Сообщение: Re: changing the size of a column without losing data
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: Simple but slow