Re: Reliably backing up a live database

From: Ken Benson <ken(at)infowerks(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Reliably backing up a live database
Date: 2013-12-31 15:16:19
Message-ID: 52C2DFC3.3020604@infowerks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On 12/31/2013 5:40 AM, Tanstaafl wrote:
> On 2013-04-15 5:36 PM, Tanstaafl <tanstaafl(at)libertytrek(dot)org> wrote:
>> I've been using the command:
>>
>> pg_dumpall --username=username -o -f mydb_backup.sql.gz
>
> Ok, please correct me...
>
> I had thought the above command would result in a gzipped database
> dump, due to the .gz extension.
>
> Obviously, this was a dumb assumption.
>
> I just tried to extract it, and got an error, but renaming the file to
> remove the .gz at the end (so it is just .sql) gives me a text file
> that loads just fine and I can see all the DB data, so obviously the
> file is not .gz compressed.
>
> Reading man pg_dump lead me to believe that I needed to add the -Fc
> flag to the above command - but, I don't see anything about what type
> of compression it uses... will it be .gz? How do I specify (ie, .gz, .gz2
>
> But...
>
> Trying the above failed with an invalid option, an a quick man
> pg_dumpall reveals that there is no -F option...
>
> So, is it possible to get a gzipped (or otherwise compressed) dump
> using pg_dumpall?
>
>

I believe you have to use
pg_dumpall --username=username -o | gzip > mydb_backup.sql.gz

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Tanstaafl 2013-12-31 15:19:28 Re: Reliably backing up a live database
Previous Message Tanstaafl 2013-12-31 13:40:11 Re: Reliably backing up a live database