Skip site navigation (1) Skip section navigation (2)

Re: Patch for pg_dump: Multiple -t options and new -T option

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "David F(dot) Skoll" <dfs(at)roaringpenguin(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>,pgsql-patches(at)postgresql(dot)org
Subject: Re: Patch for pg_dump: Multiple -t options and new -T option
Date: 2004-07-21 14:39:47
Message-ID: 8489.1090420787@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
"David F. Skoll" <dfs(at)roaringpenguin(dot)com> writes:
> How about this:

> pg_dump -t t1                          -- Dump table t1 in any schema
> pg_dump -n s1                          -- Dump all of schema s1
> pg_dump -t t1 -n s1                    -- Dump t1 in s1
> pg_dump -t t1 -t t2 -n s1              -- Dump s1.t1 and s1.t2
> pg_dump -t t1 -t t2 -n s1 -n s2        -- Dump s1.t1, s1.t2, s2.t1 and s2.t2

Why not

pg_dump -t t1                          -- Dump table t1 in any schema
pg_dump -n s1                          -- Dump all of schema s1
pg_dump -t s1.t1                       -- Dump t1 in s1
pg_dump -t s1.t1 -t s2.t2              -- Dump s1.t1 and s2.t2
pg_dump -t t1 -t t2 -n s1 -n s2        -- Dump s1.t1, s1.t2, s2.t1 and s2.t2

That is, the rules are:
	- if any -t switches appear, only tables matching (any one of)
	  those switches are dumped
	- if any -n switches appear, only objects in (any one of)
	  those schemas are dumped
	- a -t switch can be name only or schema.name

The cross-product semantics you're proposing can't implement my fourth
example.

I really dislike the idea of switch ordering making a difference...

> We also probably should not warn about missing tables, because it's
> likely that the full cartesian product of schemas and tables won't
> exist.

Agreed.  If any -t or -n switches appear, then warn only if *no* objects
get selected.

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2004-07-21 14:53:49
Subject: Re: [HACKERS] Point in Time Recovery
Previous:From: Matthew T. O'ConnorDate: 2004-07-21 14:26:35
Subject: Re: check point segments leakage ?

pgsql-patches by date

Next:From: Tom LaneDate: 2004-07-21 14:53:49
Subject: Re: [HACKERS] Point in Time Recovery
Previous:From: Bruce MomjianDate: 2004-07-21 14:30:23
Subject: Re: logfile subprocess and Fancy File Functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group