pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <ringerc@ringerc.id.au>
To: Jan Vodička <hrtlik@gmail.com>
Cc: Ryan Kelly <rpkelly22@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7590: Data corruption using pg_dump only with -Z parameter
Date: Sat, 13 Oct 2012 20:12:14 +0800
Message-ID: <50795A9E.40204@ringerc.id.au> (raw)
In-Reply-To: <CA+8ZZiLEtozdhqfONiNcC+GOkWPr8_y4QNW89EzYRoerLpQZWg@mail.gmail.com>
References: <E1TLafo-0003kU-99@wrigleys.postgresql.org>
	<20121009190233.GB2751@llserver.lakeliving.com>
	<CA+8ZZiLEtozdhqfONiNcC+GOkWPr8_y4QNW89EzYRoerLpQZWg@mail.gmail.com>

On 10/10/2012 03:07 AM, Jan Vodička wrote:
> = not able to unpack, invalid
>
> Try this one generated by "pg_dump -Z1 > backup.gz" in windows:
> http://mstu.cz/~hrtlik/backup.gz
> <http://mstu.cz/%7Ehrtlik/backup.gz; (0.5kB)
> original "pg_dump > backup.gz" without compression:
> http://mstu.cz/~hrtlik/backup.sql <http://mstu.cz/%7Ehrtlik/backup.sql;
>
> If you have any way how to get original, tell me.

If Tom is right and the issue is end-of-line transformation, in theory 
you might be able to un-mungle newlines. The chances of \r\n occurring 
naturally in a tiny backup like that are not huge, so any \r\n in the 
data probably used to be a raw \n. Taking a copy of the DB and 
performing that substitution might get you a usable backup file.

That's replacing all \x0d\x0a sequences with \x0a. Or I might be wrong 
and it's \x0d.

This won't work on a larger backup where some \r\n sequences will occur 
naturally in compressed binary data. In those you're likely to have a 
much, much bigger job ahead of you.

--
Craig Ringer




view thread (10+ messages)  latest in thread

Message-ID: <50795A9E.40204@ringerc.id.au>
Permalink:  ../50795A9E.40204@ringerc.id.au/
Also on:    postgresql.org/message-id/50795A9E.40204@ringerc.id.au

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: ringerc@ringerc.id.au, hrtlik@gmail.com, rpkelly22@gmail.com
  Subject: Re: BUG #7590: Data corruption using pg_dump only with -Z parameter
  In-Reply-To: <50795A9E.40204@ringerc.id.au>
  References: <E1TLafo-0003kU-99@wrigleys.postgresql.org> <20121009190233.GB2751@llserver.lakeliving.com> <CA+8ZZiLEtozdhqfONiNcC+GOkWPr8_y4QNW89EzYRoerLpQZWg@mail.gmail.com> <50795A9E.40204@ringerc.id.au>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox