Re: how robust are custom dumps?

From: Willy-Bas Loos <willybas(at)gmail(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: Magnus Hagander <magnus(at)hagander(dot)net>, Thom Brown <thom(at)linux(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: how robust are custom dumps?
Date: 2012-05-01 10:36:58
Message-ID: CAHnozTiD7ZRPja1jnKfBgtORWh0KLwdpXRyCn==fe67robo2mA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

great stuff!
was that already in it?
i'd plea for adding recognition of gzipped data too..

cheers,

WBL

On Wed, Apr 25, 2012 at 11:05 PM, Guillaume Lelarge
<guillaume(at)lelarge(dot)info>wrote:

> On Wed, 2012-04-25 at 10:40 +0200, Willy-Bas Loos wrote:
> > On Wed, Apr 25, 2012 at 9:51 AM, Magnus Hagander <magnus(at)hagander(dot)net
> >wrote:
> >
> > > We used to have a bug/lackoffeature in pg_dump at the 2GB boundary as
> > > well, IIRC, specifically on Win32. Maybe you were hit by that one..
> >
> > Yes, possibly. I didn't even know how to make a compressed plain dump,
> but
> > that doesn't really plea my case :/
> >
> >
> > > > i do have one suggestion.
> > > > pg_restore only gives a user this feedback, when he makes this
> > > > mistake:"pg_restore: [archiver] input file does not appear to be a
> valid
> > > > archive".
> > > >
> > > > Would it be feasible for pg_restore to detect that it is a different
> > > pg_dump
> > > > format and inform the user about it?
> > >
> > >
> > The main one you'd want to detect is plain I think - and I don't know
> > > if we can reliably detect that. It could be just a generic textfile,
> > > after all - how would we know the difference?
> > >
> >
> >
> >
> > Well, on linux you could make pg_dump run /usr/bin/file on the file to
> see
> > what kind it is. If it is gzipped, suggest that it might be a gzipped
> plain
> > dump, if it is plain text, suggest that it might be a plain dump (etc,
> > also bzip2). That's all.
> > You don't have to be sure that it is valid, just say a bit more than
> "does
> > not appear to be a valid archive". Help a user in a bad situation.
> >
> > Only, i know that postgres runs on many platforms, so you probably can't
> > run /usr/bin/file on all of those (or might not be installed on linux
> > machine). So it probably should be part of pg_restore itself.
> >
>
> pg_restore will do so for plain backups on 9.2:
>
> $ pg_dump b1 > b1.dump
> $ pg_restore -d b2 b1.dump
> pg_restore: [archiver] input file appears to be a text format dump.
> Please use psql.
>
>
> --
> Guillaume
> http://blog.guillaume.lelarge.info
> http://www.dalibo.com
>
>

--
"Quality comes from focus and clarity of purpose" -- Mark Shuttleworth

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Churcher 2012-05-01 10:55:51 Re: Having trouble with pg_dumpall -o
Previous Message Thom Brown 2012-05-01 10:22:42 Re: Having trouble with pg_dumpall -o