I wrote:
> One argument that occurs to me for importing the psql code is that it's
> solved the problem of including a schema name in the pattern.  It would
> be a lot nicer to say "-t schema.table" than to have to say "-t table -n
> schema".

The more I think about this, the more I think the above is a killer
argument.  We really should have had the ability to say "-t schema.table"
ever since schemas were added in 7.3, but no one got around to making it
happen.  If we go over to interpreting the arguments as standard regexes
then we'll never be able to do that, because we'll have foreclosed the
meaning of dot.  The psql pattern code was specifically designed as a
compromise notation adapted to SQL needs, and IMHO it's served pretty
well --- so I think we should adopt that into pg_dump rather than pure
regex notation.

> The psql code does allow you to get at most of the functionality of
> regexes...

Actually, it lets you get at all of it, though perhaps a bit awkwardly.
The transformations it makes are

        .       =>      schema vs name separator
        *       =>      .*
        ?       =>      .

So the only regex patterns you can't write directly are dot, R* and R?
for which you can use these locutions:

        .       =>      ?
        R*      =>      (R+|)
        R?      =>      (R|)

(Perhaps this should be documented somewhere...)


So I propose that we should revise the patch to use psql's \d code to
determine which objects match a pattern.  I think that together with
Greg's idea of processing all inclusions before all exclusions should
answer the concerns I've got about the patch.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to [EMAIL PROTECTED] so that your
       message can get through to the mailing list cleanly

Reply via email to