From: marcelo <marcelo.nicolet@gmail.com>
To: Sam Gendler <sgendler@ideasculptor.com>
To: Andreas Kretschmer <andreas@a-kretschmer.de>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: How to know if a database has changed
Date: Tue, 12 Dec 2017 09:14:23 -0300
Message-ID: <5246fbe0-4dc6-8a25-fa44-dcfd1bc87191@gmail.com> (raw)
In-Reply-To: <CAEV0TzBFhyFxBwSzYN=tjs+b8S5KS1oA4c+Fub69-RUwmgqe+Q@mail.gmail.com>
References: <f6d7853e-7906-bdf2-787e-95208bcdbe67@gmail.com>
<614bd145-899a-8dc9-154e-a42ad17c2685@a-kretschmer.de>
<41f78e39-75cb-9b37-46ac-119cc878f15f@a-kretschmer.de>
<CAEV0TzBFhyFxBwSzYN=tjs+b8S5KS1oA4c+Fub69-RUwmgqe+Q@mail.gmail.com>
Hi Sam
You are right, and here are the reason behind my question: The server
where postgres will be installed is not on 24/7. It turns on in the
morning and goes off at the end of the day. The idea is that, as part of
the shutdown process, a local backup is made. The next day, that backup
will be copied to the cloud.
In order not to lengthen the shutdown process, we are trying to limit
pg_dump to the databases that have had some change, not so much in their
schema as in their data.
Of course, to add a trigger for every table and CUD operation on every
database is not an option.
On 11/12/17 23:23, Sam Gendler wrote:
> I think there's a more useful question, which is why do you want to do
> this? If it is just about conditional backups, surely the cost of
> backup storage is low enough, even in S3 or the like, that a duplicate
> backup is an afterthought from a cost perspective? Before you start
> jumping through hoops to make your backups conditional, I'd first do
> some analysis and figure out what the real cost of the thing I'm
> trying to avoid actually is, since my guess is that you are deep into
> a premature optimization <http://wiki.c2.com/?PrematureOptimization;
> here, where either the cost of the duplicate backup isn't
> consequential or the frequency of duplicate backups is effectively 0.
> It would always be possible to run some kind of checksum on the backup
> and skip storing it if it matches the previous backup's checksum if
> you decide that there truly is value in conditionally backing up the
> db. Sure, that would result in dumping a db that doesn't need to be
> dumped, but if your write transaction rate is so low that backups end
> up being duplicates on a regular basis, then surely you can afford the
> cost of a pg_dump without any significant impact on performance?
>
> On Mon, Dec 11, 2017 at 10:49 AM, Andreas Kretschmer
> <andreas@a-kretschmer.de <mailto:andreas@a-kretschmer.de>> wrote:
>
>
>
> Am 11.12.2017 um 18:26 schrieb Andreas Kretschmer:
>
> it's just a rough idea...
>
>
> ... and not perfect, because you can't capture ddl in this way.
>
>
>
> Regards, Andreas
>
> --
> 2ndQuadrant - The PostgreSQL Support Company.
> www.2ndQuadrant.com <http://www.2ndQuadrant.com;
>
>
>
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: marcelo.nicolet@gmail.com, sgendler@ideasculptor.com, andreas@a-kretschmer.de
Subject: Re: How to know if a database has changed
In-Reply-To: <5246fbe0-4dc6-8a25-fa44-dcfd1bc87191@gmail.com>
References: <f6d7853e-7906-bdf2-787e-95208bcdbe67@gmail.com> <614bd145-899a-8dc9-154e-a42ad17c2685@a-kretschmer.de> <41f78e39-75cb-9b37-46ac-119cc878f15f@a-kretschmer.de> <CAEV0TzBFhyFxBwSzYN=tjs+b8S5KS1oA4c+Fub69-RUwmgqe+Q@mail.gmail.com> <5246fbe0-4dc6-8a25-fa44-dcfd1bc87191@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox