I was just bitten by an issue in pg_dump where if the table it is to dump
doesn't exist, it doesn't return an error or anything!  We only just
realised that a dump script we wrote had a typo in it, and all our 'backups'
are invalid...

This is the current CVS behaviour:

bash-2.05$ pg_dump -a -t badtable mydb
--
-- Selected TOC Entries:
--

Where 'badtable' is the name of a table that doesn't exist.

Should this beheaviour be at least modified to write something to stderr?

Chris


Fri, 8 Mar 2002 09:22:35 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
pg_dump doesn't report failure
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> This is the current CVS behaviour:

> bash-2.05$ pg_dump -a -t badtable mydb
> --
> -- Selected TOC Entries:
> --

> Where 'badtable' is the name of a table that doesn't exist.

> Should this beheaviour be at least modified to write something to stderr?

I dunno.  I think the direction we were planning to go in was that -t's
argument should be treated as a pattern to match against table names
(eg, a regexp).  It's not clear that zero matches are an error when
you are thinking in those terms.  On the other hand I can see your point
about not realizing your "backup" isn't.

			regards, tom lane

Thu, 07 Mar 2002 21:21:53 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: pg_dump doesn't report failure 
On Thu, 2002-03-07 at 21:21, Tom Lane wrote:
> I dunno.  I think the direction we were planning to go in was that -t's
> argument should be treated as a pattern to match against table names
> (eg, a regexp).  It's not clear that zero matches are an error when
> you are thinking in those terms.  On the other hand I can see your point
> about not realizing your "backup" isn't.

Can't the regex mode be made a different switch (say, -T or -E)? In
addition to allowing better error reporting, I'm uncomfortable with
saying "a table name must consist of non-regex special characters",
which is basically what this implies.

Cheers,

Neil

-- 
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC


07 Mar 2002 21:58:36 -0500
Neil Conway <nconway@klamath.dyndns.org>
Re: pg_dump doesn't report failure