Re: Updating pg_attribute to change field's data type from integer to bigint on very large table
В списке pgsql-general по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Updating pg_attribute to change field's data type from integer to bigint on very large table |
| Дата | |
| Msg-id | 23940.1334329392@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Updating pg_attribute to change field's data type from integer to bigint on very large table (Jeff Adams <jeff.adams@noaa.gov>) |
| Ответы |
Re: Updating pg_attribute to change field's data type from integer to bigint on very large table
|
| Список | pgsql-general |
Jeff Adams <jeff.adams@noaa.gov> writes:
> I have a very large table (approximately 1 billion records). I need to
> change a field's data type from integer to bigint. I started up an ALTER
> TABLE approach yesterday and it is still running (trying to rewrite the
> whole table?). I remember seeing mention of being able to do this in the
> pg_attribute table. Has anybody ever used the latter approach. If so,
> instructions would be greatly appreciated. Thanks...
No, that is an actual on-disk change (making the field physically
wider), so it's going to cost ya. There are some cases where the
on-disk representation doesn't change and so a catalog update isn't
needed, but int4->int8 isn't one of them.
regards, tom lane
В списке pgsql-general по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера