Re: What to watch out for when ALTERing NUMERIC(38,0) to BIGINT?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: What to watch out for when ALTERing NUMERIC(38,0) to BIGINT?
Дата
Msg-id 3421791.1659021999@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: What to watch out for when ALTERing NUMERIC(38,0) to BIGINT?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: What to watch out for when ALTERing NUMERIC(38,0) to BIGINT?  (Ron <ronljohnsonjr@gmail.com>)
Список pgsql-admin
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Thu, Jul 28, 2022 at 8:13 AM Ron <ronljohnsonjr@gmail.com> wrote:
>> Besides what's mentioned in
>> https://www.postgresql.org/docs/12/ddl-alter.html#id-1.5.4.8.10, what
>> happens *internally* when I run:
>> ALTER TABLE foo ALTER COLUMN bar TYPE BIGINT;

> IIUC, that would be the silver lining in all of this - the rewritten table
> would have zero fragmentation and bloat.

Yeah.  What happens internally is a table rewrite: the entire content
of the table (and its indexes) is written into a new set of files.
At commit, the old files are deleted.  The main gotchas, for a large
table, are the transient disk space consumption and the fact that the
table stays exclusively locked the whole time.

            regards, tom lane



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: What to watch out for when ALTERing NUMERIC(38,0) to BIGINT?
Следующее
От: Ron
Дата:
Сообщение: Re: What to watch out for when ALTERing NUMERIC(38,0) to BIGINT?