Re: restore whoes

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: Simone Tellini <tellini(at)areabusiness(dot)it>, pgsql-admin(at)postgresql(dot)org
Subject: Re: restore whoes
Date: 2002-02-11 18:04:00
Message-ID: 200202111804.g1BI40d23254@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > I think we can live with it _if_ we report a proper error message and
> > suggest a solution.
>
> Looking for a way to report an error message misses the point entirely,
> IMHO (even if it weren't a horrid kluge). I don't want to report an
> error message; I want to read the file successfully. If the file in
> question is your dump from an already-erased previous version, being
> told that you messed it up is no help.
>
> Adding options to the COPY command is no help either, because the COPY
> may be embedded in a multi-gigabyte dump file that you can't edit
> conveniently. (And what of pg_restore, or other applications that
> generate COPY commands?) My approach of using a GUC variable is better
> because it can be set from outside the dump script --- in
> postgresql.conf, if necessary.

OK, GUC is OK if you prefer. Report the error about the munged file,
and tell them what GUC parameter to set to load the file properly. How
is that? Of course, that GUC parameter is going to affect everyone
connecting, which seems like somewhat of a problem. I guess they could
do:

$ psql
=> SET COPYCR TO 'on';
=> \i copydumpfile

rather than modifying postgresql.conf. This will not work for
pg_restore.

Another option is to just print the sed command that would strip off the
\r from the end of the line.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message James Kelty 2002-02-11 18:24:04 Replication...???
Previous Message Simone Tellini 2002-02-11 17:43:17 Re: restore whoes