我正在尝试用PostgreSQL替换html内容。该html位于messagetemplates表中存在的“ contents”列中。我不断收到此错误:“内容”列的类型为bytea,但表达式的类型为record;提示:您将需要重写或强制转换表达式。我知道这是因为返回类型不同。谁能指出我正确完成表达表达方式的正确方向。
这是我的代码:
update org0000008.messagetemplates
set contents = replace (contents, 'Your password is: [%= :xd_paid_pass_wd %]', '<a href="https://moneymappress.com/reset-password/">Click here to reset your password</a>')
where contents in
(
SELECT mt.contents
FROM org0000008.mailings m INNER JOIN maincontrol.orgs o ON o.orgid =
m.orgid
INNER JOIN org0000008.segments s
ON s.mailingid = m.mailingid
INNER JOIN org0000008.messagetemplates mt
ON s.messagetemplateid = mt.messagetemplateid
WHERE TRUE
AND (
m.startdate >= '2018-06-01'
OR m.createddate >= '2018-06-01'
)
AND (
contents LIKE '%Your password is: [%= :xd_paid_pass_wd %]%'
)
and m.mailingid = 788733
)
非常感谢您的帮助。
谢谢!