Ich versuche, eine bytea
-Spalte zu ändern, um den Typ oid
zu haben, und behalte immer noch die Werte bei.Wandle eine Bytea-Spalte in OID um, während Werte beibehalten werden
Ich habe mit Anfragen wie versucht:
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;
Aber das gibt mir nur die Fehlermeldung:
ERROR: cannot cast type bytea to oid
Gibt es eine Möglichkeit zu erreichen, was ich will?
haben Related: http://stackoverflow.com/questions/29433041/understanding-cast-from-bytea-to-oid –