Re: How to get a more RSYNC compatible output of pg_dump?

From: Holger Jakobs <holger(at)jakobs(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: How to get a more RSYNC compatible output of pg_dump?
Date: 2022-05-16 13:23:37
Message-ID: 288d84eb-9b46-dbae-ceb4-4d2e5bc7f94e@jakobs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Am 16.05.22 um 14:50 schrieb Thorsten Schöning:
> Guten Tag Holger Jakobs,
> am Montag, 16. Mai 2022 um 12:52 schrieben Sie:
>
>> If you want to sync a new version of a file without transferring
>> the whole thing, you have to use the option -c or --checksum.
> No, --checksum is only for (slowly) recognizing changes at all,
> transfer is differential by default with or without that option.
Yes, the option causes rsync to also detect changes if the size and
timestamps haven't changed.
>> -c, --checksum skip based on checksum, not mod-time & size
> https://linux.die.net/man/1/rsync
>
>> This works well only if some blocks of the file have changed, while
>> most others haven't. This won't be the case of a pg_dump.
> It is the case for some dumps I'm creating, but those are a lot
> smaller and don't store large objects like files. Therefore I was
> wondering about the order in which pg_dump outputs tables, rows etc.,
> e.g. if that is the same always or changing with each exec for some
> reason.
>
If only one byte close to the beginning of the file is added, this would
shift all following bytes by 1, so no block of the file will be
identical and have to be re-transferred.

Therfore, the only option is creating separate files for each table.
This would transfer only those files where the content of the table has
been changed since the last transmission. There has been another answer
by depesz suggesting that.

Regards,

Holger

--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Thorsten Schöning 2022-05-16 16:48:12 Re: How to get a more RSYNC compatible output of pg_dump?
Previous Message Thorsten Schöning 2022-05-16 12:50:30 Re: How to get a more RSYNC compatible output of pg_dump?