1

I use PostgreSQL copy command to make a csv file.

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

this command is ok

But I want to make file with ANSI encoding, because I want to open it in Microsoft Excel

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

this command can't make csv file

2
  • 2
    There is no encoding "ANSI". If you mean a single-byte encoding, then you probably want ISO-8859-1 Commented Nov 7, 2016 at 10:14
  • 2
    You mean copy to Commented Nov 7, 2016 at 10:19

1 Answer 1

3

Since you seem to be on Windows, maybe you want to use one of the Windows encodings, for example WIN1252 for western European languages.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.