pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Add --exclude-database option to pg_dumpall
5+ messages / 3 participants
[nested] [flat]

* pgsql: Add --exclude-database option to pg_dumpall
@ 2019-03-01 16:13 Andrew Dunstan <andrew@dunslane.net>
  2019-03-01 17:04 ` Re: pgsql: Add --exclude-database option to pg_dumpall Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Andrew Dunstan @ 2019-03-01 16:13 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Add --exclude-database option to pg_dumpall

This option functions similarly to pg_dump's --exclude-table option, but
for database names. The option can be given once, and the argument can
be a pattern including wildcard characters.

Author: Andrew Dunstan.
Reviewd-by: Fabien Coelho and Michael Paquier
Discussion: https://postgr.es/m/43a54a47-4aa7-c70e-9ca6-648f436dd6e6@2ndQuadrant.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f092de0503cd77a8463e7089c249d5e0586a120b

Modified Files
--------------
doc/src/sgml/ref/pg_dumpall.sgml | 21 +++++++++++
src/bin/pg_dump/pg_dump.c        |  3 +-
src/bin/pg_dump/pg_dumpall.c     | 78 ++++++++++++++++++++++++++++++++++++++++
src/bin/pg_dump/t/001_basic.pl   | 13 ++++++-
src/bin/pg_dump/t/002_pg_dump.pl | 11 ++++++
5 files changed, 124 insertions(+), 2 deletions(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Add --exclude-database option to pg_dumpall
  2019-03-01 16:13 pgsql: Add --exclude-database option to pg_dumpall Andrew Dunstan <andrew@dunslane.net>
@ 2019-03-01 17:04 ` Tom Lane <tgl@sss.pgh.pa.us>
  2019-03-01 17:56   ` Re: pgsql: Add --exclude-database option to pg_dumpall Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2019-03-01 17:04 UTC (permalink / raw)
  To: Andrew Dunstan <andrew@dunslane.net>; +Cc: pgsql-committers@lists.postgresql.org

Andrew Dunstan <andrew@dunslane.net> writes:
> Add --exclude-database option to pg_dumpall

Buildfarm seems to think you got the test case wrong ...

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Add --exclude-database option to pg_dumpall
  2019-03-01 16:13 pgsql: Add --exclude-database option to pg_dumpall Andrew Dunstan <andrew@dunslane.net>
  2019-03-01 17:04 ` Re: pgsql: Add --exclude-database option to pg_dumpall Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-03-01 17:56   ` Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  2019-03-01 18:07     ` Re: pgsql: Add --exclude-database option to pg_dumpall Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Andrew Dunstan @ 2019-03-01 17:56 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org


On 3/1/19 12:04 PM, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> Add --exclude-database option to pg_dumpall
> Buildfarm seems to think you got the test case wrong ...
>
> 			


Hmm, Of course I tested this. It's passing on Linux boxes like crake and
prion, but failing on OSX and FBSD boxes.


I guess that's what we have a buildfarm for :-)


here's the error:


    #   Failed test 'pg_dumpall: option --exclude-database requires an argument: matches'
    #   at t/001_basic.pl line 154.
    #                   'pg_dumpall: option `--exclude-database' requires an argument
    # Try "pg_dumpall --help" for more information.
    # '
    #     doesn't match '(?^:pg_dumpall\:\ option\ \'\-\-exclude\-database\'\ requires\ an\ argument)'


Why is that backtick there? That looks like the culprit, coming from the
GetOpt implementation presumably.


I guess I can replace the first quote with a class containing ['`]


cheers


andrew


-- 
Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Add --exclude-database option to pg_dumpall
  2019-03-01 16:13 pgsql: Add --exclude-database option to pg_dumpall Andrew Dunstan <andrew@dunslane.net>
  2019-03-01 17:04 ` Re: pgsql: Add --exclude-database option to pg_dumpall Tom Lane <tgl@sss.pgh.pa.us>
  2019-03-01 17:56   ` Re: pgsql: Add --exclude-database option to pg_dumpall Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
@ 2019-03-01 18:07     ` Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  2019-03-01 18:51       ` Re: pgsql: Add --exclude-database option to pg_dumpall Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Andrew Dunstan @ 2019-03-01 18:07 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-committers@lists.postgresql.org


On 3/1/19 12:56 PM, Andrew Dunstan wrote:
> On 3/1/19 12:04 PM, Tom Lane wrote:
>> Andrew Dunstan <andrew@dunslane.net> writes:
>>> Add --exclude-database option to pg_dumpall
>> Buildfarm seems to think you got the test case wrong ...
>>
>> 			
>
> Hmm, Of course I tested this. It's passing on Linux boxes like crake and
> prion, but failing on OSX and FBSD boxes.
>
>
> I guess that's what we have a buildfarm for :-)
>
>
> here's the error:
>
>
>     #   Failed test 'pg_dumpall: option --exclude-database requires an argument: matches'
>     #   at t/001_basic.pl line 154.
>     #                   'pg_dumpall: option `--exclude-database' requires an argument
>     # Try "pg_dumpall --help" for more information.
>     # '
>     #     doesn't match '(?^:pg_dumpall\:\ option\ \'\-\-exclude\-database\'\ requires\ an\ argument)'
>
>
> Why is that backtick there? That looks like the culprit, coming from the
> GetOpt implementation presumably.
>
>
> I guess I can replace the first quote with a class containing ['`]



... and on Windows the result is radically different:


    #   Failed test 'pg_dumpall: option --exclude-database requires an argument: matches'
    #   at t/001_basic.pl line 154.
    #                   'H:\prog\bf\root\HEAD\pgsql.build\tmp_install\bin\pg_dumpall.EXE: option requires an argument -- exclude-database
    # Try "pg_dumpall --help" for more information.
    # '
    #     doesn't match '(?^:pg_dumpall\:\ option\ \'\-\-exclude\-database\'\ requires\ an\ argument)'


I'm somewhat inclined just to abandon the test. It's at best of marginal
use.


cheers


andrew

-- 

Andrew Dunstan                https://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: pgsql: Add --exclude-database option to pg_dumpall
  2019-03-01 16:13 pgsql: Add --exclude-database option to pg_dumpall Andrew Dunstan <andrew@dunslane.net>
  2019-03-01 17:04 ` Re: pgsql: Add --exclude-database option to pg_dumpall Tom Lane <tgl@sss.pgh.pa.us>
  2019-03-01 17:56   ` Re: pgsql: Add --exclude-database option to pg_dumpall Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
  2019-03-01 18:07     ` Re: pgsql: Add --exclude-database option to pg_dumpall Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
@ 2019-03-01 18:51       ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2019-03-01 18:51 UTC (permalink / raw)
  To: Andrew Dunstan <andrew.dunstan@2ndquadrant.com>; +Cc: pgsql-committers@lists.postgresql.org

Andrew Dunstan <andrew.dunstan@2ndquadrant.com> writes:
> [ getopt has platform-dependent error message spelling ]
>
> I'm somewhat inclined just to abandon the test. It's at best of marginal
> use.

Agreed.  It seems barely worth the test cycles to begin with, and
surely not worth coping with all the different ways this error
message might be spelled.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2019-03-01 18:51 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-03-01 16:13 pgsql: Add --exclude-database option to pg_dumpall Andrew Dunstan <andrew@dunslane.net>
2019-03-01 17:04 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-03-01 17:56   ` Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
2019-03-01 18:07     ` Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
2019-03-01 18:51       ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox