Converter uma coluna bytea em OID, mantendo valores

Estou tentando alterar umbytea coluna para ter tipooid e ainda reter os valores.

Eu tentei usar consultas como:

ALTER TABLE mytable ADD COLUMN mycol_tmp oid;
UPDATE mytable SET mycol_tmp = CAST(mycol as oid);
ALTER TABLE mytable DROP COLUMN mycol;
ALTER TABLE mytable RENAME mycol_tmp TO mycol;

Mas isso só me dá o erro:

ERROR: cannot cast type bytea to oid

Existe alguma maneira de conseguir o que eu quero?