Changing column type from oid to int4

From: Mario Weilguni <mweilguni(at)sime(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Changing column type from oid to int4
Date: 2004-12-02 16:36:36
Message-ID: 200412021736.36159.mweilguni@sime.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Did somebody ever try to change the type to a compatible type? I plan to
change a column from oid to int (once it holded a lob, now some sort of id)
with modifying pg_attribute:

update pg_attribute
set atttypid=(select oid from pg_type where typname='int4')
where attname='whatever'
and attrelid=(select oid from pg_class where relname='a_table_name');

It seems to work fine, but I was not sure so I rolled back the change.

So, has anyone ever tried this?

Regards,
Mario Weilguni

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joshua D. Drake 2004-12-02 16:53:00 Re: pg_restore taking 4 hours!
Previous Message Thomas F.O'Connell 2004-12-02 16:34:27 Re: Poor Performance with Distinct Subqueries with EXISTS and EXCEPT