postgresqlunicodeutf-8character-encodingeuro

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


I only found some strange results online where somebody tried select E'\x020AC', select E'\x020\x0AC' or select E'\x0AC\x020' but none worked.


Solution

  • So I had to search and read more carefully in the pg docs and found the solution:

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