UTF-8. When I connects to it using
psqlon Windows, it complains with the following,
foopgdb => select * from bar; ERROR: character with byte sequence 0xe2 0x86 0x92 in encoding "UTF8" has no equivalent in encoding "WIN1252" foopgdb =>
Method 1It turns out that we can inform
psqlthe encoding and select proper encoding table when we run psql as follows in a Windows Command Prompt window,
SET PGCLIENTENCODING=utf-8 chcp 65001
The explanation about
PGCLIENTENCODINGis in the PostgreSQL documentation while that of
chcpat Microsoft Technet. The reference to the code page
65001is at this MSDN page.
However, the above method may result in the
Not enough memory erroron some version of Windows, such as, Windows 7. See this discussion for more.
Method 2We can also set the encoding in
foopgdb => \encoding UTF8 foopgdb => select * from bar; ...... foopgdb =>