Search Postgresql Archives

Re: Discovering time of last database write

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2007-01-08 at 02:22, Andy Dale wrote:
> Hi,
> 
> Sorry for the slight delay in my response.
> 
> I am using 3 PostgreSQL databases and writing to them using an SQL
> proxy.  These databases have a high write volume.  On rebooting all 3
> servers for OS/Software updates, i would like to figure out which was
> the last written to DB (this is assuming the DB/Servers are not all
> taken down at the same time), the times are kept in sync with NTP. 
> 
> I imagine it is possible to get this behaviour with after triggers,
> but this means i have to attach the same trigger to each table ??

Hmmmm.   Still not completely clear on what exactly you're doing, but I
think I am getting an idea.

You could set each table to have a field for a timestamp, and build a
simple rule / trigger that updates it with the current time stamp for
every row as it's inserted / updated.  Then you could select
max(timestampcolumn) from a table to see which db had the latest
version.

I still think there might be a better solution to your problem.  Can we
get a more generic overview of what you're trying to do.  The 10,000 
foot high view, so to speak.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux