[Pgpool-general] Time differences

Simone Tregnago simonetregnago at grivaonline.com
Thu Oct 9 06:36:16 UTC 2008


Adonias Malosso wrote:
> Bruno,
> 
> If you have less than 1 second difference between the hosts you could 
> try to truncate the current timestamp result to seconds or minutes, 
> depending on your application needs, for example:
> 
> UPDATE public.transporte SET ativo = false, ts = CURRENT_TIMESTAMP
> WHERE age(date_trunc('minute', current_timestamp)::timestamp,ts) > '2 hours'
> 
> 

that's not safe: if the shift of the second (or the minute, or any other
unit you'll use to truncate) occurs during the execution you could have
different values again. So increasing the cut only reduce the
probability of the error, but it's not sure and it shouldn't be a safe
implementation.


More information about the Pgpool-general mailing list