Re: pg_dump exclusion switches and functions/types

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Kris Jurka <books(at)ejurka(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pg_dump exclusion switches and functions/types
Date: 2006-10-07 21:29:03
Message-ID: 5026.1160256543@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Sergey E. Koposov 2006-10-07 23:23:16 Re: FailedAssertion() in 8.2beta1
Previous Message Josh Berkus 2006-10-07 21:21:12 Re: pg_dump exclusion switches and functions/types