如何使用 ANSI 编码的 postgresql 复制命令?

How to use postgresql copy command with ANSI encoding?

我使用 PostgreSQL 复制命令制作一个 csv 文件。

COPY (select * from table) from '/tmp/123456.csv' with csv header encoding 'UTF8';

这个命令没问题

但我想用 ANSI 编码制作文件,因为我想在 Microsoft 中打开它 Excel

COPY (select * from table) from '/tmp/123456.csv' with csv header encoding 'ANSI';

此命令无法生成csv文件

由于您似乎使用 Windows,也许您想使用 Windows encodings 之一,例如 WIN1252 用于西欧语言。