2023年8月3日发(作者:)
PostgresSQL中bytea类型字段更新bytea转text,select、update⽅法PostgresSQL中 bytea类型字段更新 bytea 转text,select 、update⽅法查询数据SELECT id_,name_,bytes_,encode(bytes_,'escape') bytes_text,replace(encode(bytes_,'escape'),'902924','13513801')::bytea bytes_bytea
FROM act_ge_bytearray
where name_ ~*'新增'修改byteaupdate act_ge_bytearray
set bytes_=replace(encode(bytes_,'escape'),'902924','13513801')::bytea
where name_ ~*'新增'and encode(bytes_,'escape') ~*'902924'转换说明cast (‘bytes_text’ as bytea) 将text转为bytea‘bytes_text’ ::bytea 将text转为byteaencode(bytes_text::bytea,‘escape’) 将bytea 转为text
2023年8月3日发(作者:)
PostgresSQL中bytea类型字段更新bytea转text,select、update⽅法PostgresSQL中 bytea类型字段更新 bytea 转text,select 、update⽅法查询数据SELECT id_,name_,bytes_,encode(bytes_,'escape') bytes_text,replace(encode(bytes_,'escape'),'902924','13513801')::bytea bytes_bytea
FROM act_ge_bytearray
where name_ ~*'新增'修改byteaupdate act_ge_bytearray
set bytes_=replace(encode(bytes_,'escape'),'902924','13513801')::bytea
where name_ ~*'新增'and encode(bytes_,'escape') ~*'902924'转换说明cast (‘bytes_text’ as bytea) 将text转为bytea‘bytes_text’ ::bytea 将text转为byteaencode(bytes_text::bytea,‘escape’) 将bytea 转为text
发布评论