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

From: Jeff Adams <jeff(dot)adams(at)noaa(dot)gov>
To: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Updating pg_attribute to change field's data type from integer to bigint on very large table
Date: 2012-04-13 12:41:39
Message-ID: CA+BdxK-MG+88wHbXRbeFNgJtFYnHdHb3xxejve_FSZP_6z=4Nw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

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...

Jeff

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sergey Konoplev 2012-04-13 13:07:18 Re: Query optimization
Previous Message Ivan Evtuhovich 2012-04-13 12:36:28 Re: Two entries with the same primary key