Re: Cases where alter table set type varchar(longer length) stillneeds table rewrite

Поиск
Список
Период
Сортировка
От Jeremy Finzel
Тема Re: Cases where alter table set type varchar(longer length) stillneeds table rewrite
Дата
Msg-id CAMa1XUjvFg0QVgcXTDpPn0o0ksjfdbAfz72o2kj6Ghy0=BTDoA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Cases where alter table set type varchar(longer length) stillneeds table rewrite  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general


On Mon, Feb 17, 2020 at 10:46 AM Adrian Klaver <adrian.klaver@aklaver.com> wrote:

How about?:

https://www.postgresql.org/docs/9.6/sql-altertable.html

"Adding a column with a DEFAULT clause or changing the type of an
existing column will require the entire table and its indexes to be
rewritten. As an exception when changing the type of an existing column,
if the USING clause does not change the column contents and the old type
is either binary coercible to the new type or an unconstrained domain
over the new type, a table rewrite is not needed; but any indexes on the
affected columns must still be rebuilt. Adding or removing a system oid
column also requires rewriting the entire table. Table and/or index
rebuilds may take a significant amount of time for a large table; and
will temporarily require as much as double the disk space."

>
> Thanks!
> Jeremy


--
Adrian Klaver
adrian.klaver@aklaver.com

You mean the part "any indexes on the affected columns must still be rebuilt"?  Yes, I guess that is pretty clear.  Thanks,

Jeremy

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Cases where alter table set type varchar(longer length) still needs table rewrite
Следующее
От: Loai Abdallatif
Дата:
Сообщение: Re: Postgres error