Chris McCormick <cmccormick@mailsnare.net> writes:
> It ran for a while (creating all the table defs) and the I got the
> following messages:
> pg_restore: ERROR: literal carriage return found in data.
> So, I had some bad carriage returns. I found an answer at
> (http://forums.devshed.com/archive/t-99865), which suggested using sed
> to fix the carriage returns. I did that, creating backup2.tar.
You can't do that to a tar (or custom) format dump file, because you'll
clobber the tar metadata, which is full of raw-binary numbers, not to
mention absolute file lengths that will be wrong after sed hacks the data.
The basic problem here is that COPY's handling of embedded CRs changed
somewhere around 7.2, and the backwards compatibility kluge that was in
place for awhile isn't there anymore in 7.4.
Probably the least painful solution is to repeat the dump, adding the -d
switch (or whichever one it is that selects dump-as-INSERTs instead of
dump-as-COPY). This will take much longer to restore :-( but a manual
solution that allows COPY will probably take even longer in total.
If you can't repeat the dump because you don't have the original 7.1
installation anymore, you might be forced into a serial upgrade: install
7.2, reload, dump, install 7.4, reload. I think you can skip 7.3,
or skip 7.2 and use 7.3 as the intermediate step --- IIRC both 7.2 and
7.3 contain the backwards-compatibility kluge for the old COPY data
format.
regards, tom lane