Re: Interactive docs idea

From: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
To: Dave Page <dpage(at)vale-housing(dot)co(dot)uk>
Cc: gsstark(at)mit(dot)edu, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Interactive docs idea
Date: 2005-04-15 15:52:36
Message-ID: 20050415155236.GR58835@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Apr 15, 2005 at 08:42:45AM +0100, Dave Page wrote:
> [pgsql-slavestothewww] Comment 2333 added to page install-upgrading.html of version 7.4
> Author: Shayne Hardesty <0nuty1qz6jv0p1w001(at)sneakemail(dot)com>
> ----
> If you use pg_dump on an older version (say 7.1.x, 7.2.x, or 7.3.x) you will get complains from psql about carriage returns must be represented as literal \r. The workaround for this is to use the -d argument with pg_dump to dump as insert statements, but that makes restore ungodly slow (prohibitively slow in my case). In one data test I did the restore took 4 days - not workable for a production SQL environment.
>
> The solution I found was to put together a perl script to clean the output of "pg_dump <<dbname>> > <<file>>" to change carriage returns to \r. I'm sharing my script here in hopes someone finds it useful.
>
> -- BEGIN clean-pgdump.pl --
> #!/usr/bin/perl -w
>
> use strict;
>
> my $file = shift @ARGV || '';
> die "no input file specified\n" unless $file;
>
> open(FILE, $file) || die "cannot read file: $!\n";
> while (<FILE>) {
> s'\r\\\n'\\r'go;
> s'\r'\\r'go;
>
> print;
> }
> close(FILE);
>
> exit;
> -- END clean-pgdump.pl --
>
> Execute the script with ./clean-pgdump.pl <<file>> > <<newfile>>
> Then run "psql -d template1 -f <<newfile>>" to import

I think this comment is a good example of a problem with the current
system; this comment applies to both 7.4 and 8.0, but it's only in the
7.4 version. It's also long enough that it might not get into the
mainline docs (though I'm completely guessing there). It would be useful
if there was a way to have a comment cross versions.
--
Jim C. Nasby, Database Consultant decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim C. Nasby 2005-04-15 16:31:44 Re: Constant time insertion into highly non-unique
Previous Message Magnus Hagander 2005-04-15 15:30:16 Kerberos patch in the queue