Re: pg_restore ignore error patch

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: pg_restore ignore error patch
Date: 2004-04-20 01:51:00
Message-ID: 200404200151.i3K1p0v08934@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I looked over the patch and it seems to continue on pg_restore errors by
> > default. That isn't good. By default, any error should make it exit
> > loudly.
>
> I'm not sure of that. pg_dump is really designed and tested for the
> case of text dump to a psql script, and if there is an error in the psql
> script, psql will print it out and continue. In the cases I have seen
> where pg_restore operates differently from that paradigm, the pg_restore
> behavior of curling up and dying has *never* been the right thing.
>
> I haven't looked at the details of Fabien's patch, but I'm in agreement
> with the overall goal.

Oh, OK, so make it behave like pg_dump's text output piped into psql.

The patch is quite clean and just changes die to warn for pg_restore,
and reports the number of errors on completion.

The only thing that it needs is to change pg_restore so it returns a
non-zero error if there were any warnings printed. I can make that
change easily.

I will add it to the patch queue.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-04-20 01:52:26 Re: pg_restore ignore error patch v2
Previous Message Tom Lane 2004-04-20 01:41:38 Re: pg_restore ignore error patch