Re: pg_dump exclusion switches and functions/types - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_dump exclusion switches and functions/types
Date
Msg-id 5026.1160256543@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_dump exclusion switches and functions/types  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: pg_dump exclusion switches and functions/types  ("Jim C. Nasby" <jim@nasby.net>)
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: pg_dump exclusion switches and functions/types
Next
From: "Sergey E. Koposov"
Date:
Subject: Re: FailedAssertion() in 8.2beta1