Facing issue while Convert Datatype BYTEA to Text/Character
--select pg_catalog.decode('434F4D4D 4F4E', 'hex');
--select pg_catalog.encode('COMMON', 'hex');
--Query Table where col_1 has data type character varying and hex value is inserted
select col_1,pg_catalog.decode(col_1,'hex') from schema.table_1 limit 10
I have above table where i have inserted hex value in one of the column, now i want to update that, but it is giving me error
ERROR: column "col_1" is of type character varying but expression is of type bytea
LINE 1: update schema.table_1 set col_1 = pg_c...
HINT: You will need to rewrite or cast the expression.
********** Error **********
--Update Query
update schema.table_1 set col_1 = pg_catalog.decode(col_1,'hex')
Please help to resolve this