Re: How to know if a database has changed

From: James Keener <jim(at)jimkeener(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org,marcelo <marcelo(dot)nicolet(at)gmail(dot)com>,"pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to know if a database has changed
Date: 2017-12-11 17:01:27
Message-ID: 50A775BB-BED3-4840-9146-B1F9B3D91354@jimkeener.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The two non elegant ways I can think of is checking the modification time on the files representing the database and a query that checks the pk of all tables. If they're ordered pk you could store the max of them and then compare, otherwise the max of an updated at column would work as well.

Jim

On December 11, 2017 11:48:44 AM EST, marcelo <marcelo(dot)nicolet(at)gmail(dot)com> wrote:
>The installation I'm planning will manage several databases, but not
>all
>of them will change every day.
>In order to planning/scripting the pg_dump usage, I would need to know
>which databases had some change activity at the end of some day.
>How can it be done?
>TIA

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jaime Casanova 2017-12-11 17:13:07 Re: How to know if a database has changed
Previous Message Karsten Hilbert 2017-12-11 17:01:01 Re: pg_dump and logging