Changing column type from oid to int4 - Mailing list pgsql-general

From Mario Weilguni
Subject Changing column type from oid to int4
Date
Msg-id 200412021736.36159.mweilguni@sime.com
Whole thread Raw
Responses Re: Changing column type from oid to int4  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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


pgsql-general by date:

Previous
From: Thomas F.O'Connell
Date:
Subject: Re: Poor Performance with Distinct Subqueries with EXISTS and EXCEPT
Next
From: Richard Huxton
Date:
Subject: Re: md5 checksum mismatch