public inbox for [email protected]  
help / color / mirror / Atom feed
From: Adrian Klaver <[email protected]>
To: Tomas Vondra <[email protected]>
To: Andy Hartman <[email protected]>
To: [email protected]
Subject: Re: Backup
Date: Wed, 16 Oct 2024 13:32:12 -0700
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
References: <CAEZv3cqct1WFb9KYmYa5kjdxfVK8JEFdzbJ5bRL6b4r+XR2dug@mail.gmail.com>
	<[email protected]>

On 10/16/24 12:52, Tomas Vondra wrote:
> On 10/16/24 21:37, Andy Hartman wrote:
>> I am very new to Postgres and have always worked in the mssql world. I'm

> You didn't specify the Postgres version - that matters, because older
> pg_dump versions (before PG 16) do not support compression. Since PG 16
> you can use either -Fc or -Fd (instead of the tar format), and it'll
> compress the output using gzip.

Oh, it goes back further then that:

https://www.postgresql.org/docs/7.1/app-pgdump.html

"-F format, --format=format

     Format can be one of the following:

     p

         output a plain text SQL script file (default)
     t

         output a tar archive suitable for input into pg_restore. Using 
this archive format allows reordering and/or exclusion of schema 
elements at the time the database is restored. It is also possible to 
limit which data is reloaded at restore time.
     c

         output a custom archive suitable for input into pg_restore. 
This is the most flexible format in that it allows reordering of data 
load as well as schema elements. This format is also compressed by default.

"

> 
> Alternatively, you can use --compress=method:level (the supported
> methods depend on how the packages were built, no idea what platform
> you're on etc.). See
> 
>    https://www.postgresql.org/docs/current/app-pgdump.html
> 
> If you're on older version, you should be able to write the dump to
> standard output, and compress that way. Something like
> 
>    pg_dump -Fc | gzip -c > compressed.dump.gz
> 
> However, be aware that pg_dump is more an export tool than a backup
> suitable for large databases / quick recovery. It won't allow doing PITR
> and similar stuff.
> 
> 
> regards
> 

-- 
Adrian Klaver
[email protected]







view thread (2+ messages)

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Backup
  In-Reply-To: <[email protected]>

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

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