public inbox for [email protected]  
help / color / mirror / Atom feed
Re: Backup
2+ messages / 2 participants
[nested] [flat]

* Re: Backup
@ 2024-10-16 19:52  Tomas Vondra <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Tomas Vondra @ 2024-10-16 19:52 UTC (permalink / raw)
  To: Andy Hartman <[email protected]>; [email protected]

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
> looking for suggestions on DB backups. I currently have a DB used to
> store Historical information that has images it's currently around 100gig. 
> 
> I'm looking to take a monthly backup as I archive a month of data at a
> time. I am looking for it to be compressed and have a machine that has
> multiple cpu's and ample memory.
> 
> Suggestions on things I can try ?  
> I did a pg_dump using these parms
> --format=t --blobs lobarch
> 
> it ran my device out of storage:
> 
> pg_dump: error: could not write to output file: No space left on device
> 
> I have 150gig free on my backup drive... can obviously add more
> 
> looking for the quickest and smallest backup file output...
> 
> Thanks again for help\suggestions 
> 

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.

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

-- 
Tomas Vondra







^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Backup
@ 2024-10-16 20:32  Adrian Klaver <[email protected]>
  parent: Tomas Vondra <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Adrian Klaver @ 2024-10-16 20:32 UTC (permalink / raw)
  To: Tomas Vondra <[email protected]>; Andy Hartman <[email protected]>; [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]







^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-10-16 20:32 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-10-16 19:52 Re: Backup Tomas Vondra <[email protected]>
2024-10-16 20:32 ` Adrian Klaver <[email protected]>

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