Re: pg_restore ignore error patch

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: pg_restore ignore error patch
Date: 2004-04-09 19:32:06
Message-ID: 28138.1081539126@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr> writes:
> please find a small patch submission so that "pg_restore" ignores some sql
> errors.

Yeah, we've been talking about doing that for awhile. But please define
"some errors" --- what do you ignore exactly?

+ if (AH->n_errors)
+ /* translator: %s stands for "error" or "errors" */
+ fprintf(stderr, _("warning: %d %s ignored on restore\n"),
+ /* translator: in sentence warning: 123 errors ignored... */
+ AH->n_errors, AH->n_errors>1? _("errors"): _("error"));

Please read the message style guidelines: the above goes directly
against the advice for writing translatable messages.

Also, it might be wise to return a nonzero exit code when any errors are
ignored. I'm not sure about that, but it might be best to err on the
side of caution...

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-04-09 20:41:26 Re: stdin/stdout mismatch for COPY and \copy
Previous Message Andrew Dunstan 2004-04-09 19:15:50 Re: pg_restore ignore error patch