Re: ALTER TEXT field to VARCHAR(1024)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: ALTER TEXT field to VARCHAR(1024)
Дата
Msg-id 17116.1411406545@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: ALTER TEXT field to VARCHAR(1024)  (David G Johnston <david.g.johnston@gmail.com>)
Список pgsql-general
David G Johnston <david.g.johnston@gmail.com> writes:
> In the end the two questions are:
> 1) does adding a length restriction cause a table rewrite?

Yes.  In principle the restriction could be checked with just a scan,
not a rewrite, but ALTER TABLE doesn't currently understand that --- and
in any case a scan would still be potentially a long time.

> 2) what level of locking occurs while the length check is resolving?

AccessExclusiveLock.  This would be necessary in any case for a data type
change.

            regards, tom lane


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

Предыдущее
От: David G Johnston
Дата:
Сообщение: Re: ALTER TEXT field to VARCHAR(1024)
Следующее
От: Luke Coldiron
Дата:
Сообщение: large table