如何在 postgres UTF8 客户端编码中获取“€”(u+20AC)字符?

How to get a "€" (u+20AC) character in a postgres UTF8 client encoding?

我只在网上发现了一些奇怪的结果,有人尝试 select E'\x020AC'select E'\x020\x0AC'select E'\x0AC\x020' 但 none 有效。

所以我不得不在pg docs中仔细搜索和阅读并找到了解决方案:

select U&'AC'  -- => "€"
select E'\u20AC'  -- => "€"