public inbox for [email protected]  
help / color / mirror / Atom feed
From: Justin Pryzby <[email protected]>
To: Pavel Stehule <[email protected]>
Cc: Stephen Frost <[email protected]>
Cc: Surafel Temesgen <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: Alvaro Herrera <[email protected]>
Cc: vignesh C <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: Daniel Gustafsson <[email protected]>
Subject: Re: proposal: possibility to read dumped table's name from file
Date: Tue, 17 Nov 2020 15:53:21 -0600
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAFj8pRDTmY0A1RzrS9csuzsq7+PHqcAui09ZGO_48vOBOfZt1Q@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<CAFj8pRBDbbmBf=eQTvpkf0=JJsG2t6qxMGPqpJRrq-M2WJQESA@mail.gmail.com>
	<CALAY4q9u30L7oGhbsfY3dPECQ8SrYa8YO=H-xOn5xWUeiEneeg@mail.gmail.com>
	<CAFj8pRCEBbB3iUqqXsj4wawjHteB2oMHRf1R4wucUzstm=fpkA@mail.gmail.com>
	<CAFj8pRCJ-F6RGmLsoO37oz75kZcwKr39c5Y4YWbd3e=nkwDOPA@mail.gmail.com>
	<CAFj8pRDCOgPLo1WNC8iniP0g6nGQdpVj-k5T3BsYrmOBtDSShw@mail.gmail.com>
	<[email protected]>
	<CAFj8pRAZLSk+6cXtWwjSnPB9S7aE6LrgeqUpHEZKMRd7Ve9DwA@mail.gmail.com>
	<CAFj8pRDTmY0A1RzrS9csuzsq7+PHqcAui09ZGO_48vOBOfZt1Q@mail.gmail.com>

On Wed, Nov 11, 2020 at 06:49:43AM +0100, Pavel Stehule wrote:
> Perhaps this feature could co-exist with a full blown configuration for
> >> pg_dump, but even then there's certainly issues with what's proposed-
> >> how would you handle explicitly asking for a table which is named
> >> "  mytable" to be included or excluded?  Or a table which has a newline
> >> in it?  Using a standardized format which supports the full range of
> >> what we do in a table name, explicitly and clearly, would address these
> >> issues and also give us the flexibility to extend the options which
> >> could be used through the configuration file beyond just the filters in
> >> the future.

I think it's a reasonable question - why would a new configuration file option
include support for only a handful of existing arguments but not the rest.

> > This is the correct argument - I will check a possibility to use strange
> > names, but there is the same possibility and functionality like we allow
> > from the command line. So you can use double quoted names. I'll check it.
> 
> I checked
> echo "+t \"bad Name\"" | /usr/local/pgsql/master/bin/pg_dump --filter=/dev/stdin
> It is working without any problem

I think it couldn't possibly work with newlines, since you call pg_get_line().
I realize that entering a newline into the shell would also be a PITA, but that
could be one *more* reason to support a config file - to allow terrible table
names to be in a file and avoid writing dash tee quote something enter else
quote in a pg_dump command, or shell script.

I fooled with argument parsing to handle reading from a file in the quickest
way.  As written, this fails to handle multiple config files, and special table
names, which need to support arbitrary, logical lines, with quotes surrounding
newlines or other special chars.  As written, the --config file is parsed
*after* all other arguments, so it could override previous args (like
--no-blobs --no-blogs, --file, --format, --compress, --lock-wait), which I
guess is bad, so the config file should be processed *during* argument parsing.
Unfortunately, I think that suggests duplicating parsing of all/most the
argument parsing for config file support - I'd be happy if someone suggested a
better way.

BTW, in your most recent patch:
s/empty rows/empty lines/
unbalanced parens: "invalid option type (use [+-]"

@cfbot: I renamed the patch so please ignore it.

-- 
Justin


view thread (181+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: proposal: possibility to read dumped table's name from file
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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