Search Postgresql Archives

Re: Updating pg_attribute to change field's data type from integer to bigint on very large table

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff Adams <jeff.adams@xxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux