Re: Alter definition of a column

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Alter definition of a column
Дата
Msg-id 20070119141800.GB10356@svana.org
обсуждение исходный текст
Ответ на Re: Alter definition of a column  (af300wsm@gmail.com)
Ответы Re: Alter definition of a column  ("Kelly Burkhart" <kelly.burkhart@gmail.com>)
Список pgsql-general
On Thu, Jan 18, 2007 at 06:27:04AM -0800, af300wsm@gmail.com wrote:
> ksherlock@gmail.com wrote:
> > Using ALTER TABLE <table> ALTER <field> TYPE VARCHAR(<newsize>) to
> > change the size requires scanning the entire table.  For large tables,
> > this will be much slower than the pg_attribute query.  Both will get
> > the job done.
>
> Thanks.  Am I correct in assuming that this scanning of the entire
> table is done when I use the 'ALTER TABLE' command and not something I
> must do after it's done?

ALTER TABLE, to be correct, actually has to check the entire table to
make sure it's ok. By doing it directly you're basically telling the DB
it's OK.

For making a varchar column longer it's safe though, and the easiest way.

Have a ncie day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: "Shoaib Mir"
Дата:
Сообщение: Re: Who is Slony Master/Slave + general questions.
Следующее
От: Martijn van Oosterhout
Дата:
Сообщение: Re: Clearing plans