Re: Increasing Table Column Size in 7.0 Syntax

Поиск
Список
Период
Сортировка
От Richard Poole
Тема Re: Increasing Table Column Size in 7.0 Syntax
Дата
Msg-id 20001101181129.P21112@office.vi.net
обсуждение исходный текст
Ответ на Increasing Table Column Size in 7.0 Syntax  ("J. Atwood" <jatwood@bwanazulia.com>)
Ответы Re: Increasing Table Column Size in 7.0 Syntax  (Marc SCHAEFER <schaefer@alphanet.ch>)
RE: Increasing Table Column Size in 7.0 Syntax  ("Tamsin" <tg_mail@bryncadfan.co.uk>)
Список pgsql-general
On Wed, Nov 01, 2000 at 12:43:45PM -0500, J. Atwood wrote:
> Hello,
>
> Looking at the docs for pgsql I have only found stuff on altering a table
> for default and renaming a column but nothing on changing the size. I want
> to increase the size of a field from 2048 to 4096.
>
> What is the syntax for this?

You mean, e.g., a field declared varchar(2048) and now you'd like it to
be varchar(4096)?

Short answer: you can't.

Long answer: create a new table with the same columns, except give the
one you want to change its new size. Then copy all the data across
from one table to the other, drop the old table, and rename the new
one to the old one's name. If you have other long fields in that table,
beware of the 8k limit on the total length of a row - see my post of
ten minutes ago...

Richard

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

Предыдущее
От: Sion Morris
Дата:
Сообщение: ...
Следующее
От: steve@foxx.uklinux.net (Stephen Patterson)
Дата:
Сообщение: database and table listing