On Monday, July 20, 2020, <
tutiluren@tutanota.com> wrote:
possibly "only" on Windows (only tested there):
It doesn't matter if you add quotes, which always works in PG SQL queries and which is just "how you do it".
pg_dump --format plain --verbose --file "C:\test.txt" --exclude-table-data="Personal stöff"."My däiary" --host="localhost" --port="5432" --username="postgres" --dbname="TestDB"
I've also tried a million variations of those quotes as well, including nested ones, and also tried with and without the --encoding option as well as setting the environment variable for encoding. It doesn't seem to matter -- it either fails to run the command or runs it but just ignores the exclude rules.
Not sure about encoding dynamics but your issue is likely with writing shell commands. Instead of trying to write a full pg_dump command I suggest trying to set the value of an environment variable to the double-quoted value you want (checking it with echo) and then just supplying that variable with the pg_dump command.
Shells tend to use backslash for escaping (see the example on the pg_dump doc reference page) so you may want to try that. Or research on the internet for the information and examples relevant to which ever shell you are using in Windows. I’m personally experienced with Linux.
David J.