Re: pg_dump's "--exclude-table" and "--exclude-table-data" options are ignored and/or cause the dump to fail entirely unless both the schema and table name use 1950s-era identifiers.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: "tutiluren(at)tutanota(dot)com" <tutiluren(at)tutanota(dot)com>
Cc: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_dump's "--exclude-table" and "--exclude-table-data" options are ignored and/or cause the dump to fail entirely unless both the schema and table name use 1950s-era identifiers.
Date: 2020-07-21 06:59:27
Message-ID: CAKFQuwZwyokROXF2LLxE2DNo2fcunRCHO5k56_OrE9JitAUyYQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Monday, July 20, 2020, <tutiluren(at)tutanota(dot)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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-07-21 07:44:54 BUG #16547: ECPG can't CALL the procedure which has INOUT parameter
Previous Message Pavel Stehule 2020-07-21 06:43:54 Re: pg_dump's "--exclude-table" and "--exclude-table-data" options are ignored and/or cause the dump to fail entirely unless both the schema and table name use 1950s-era identifiers.