Re: Need timestamp function that will change within a transaction - Mailing list pgsql-general

From Steve Atkins
Subject Re: Need timestamp function that will change within a transaction
Date
Msg-id 2A9D160B-A5C2-43BE-9B8E-DC34BD256FD4@blighty.com
Whole thread Raw
In response to Need timestamp function that will change within a transaction  ("D. Dante Lorenso" <dante@lorenso.com>)
List pgsql-general
On May 14, 2008, at 12:56 PM, D. Dante Lorenso wrote:

> I'd like to find a timestamp function that WILL change within a
> transaction.
>
> This function will return to me a 15 digit BIGINT number in base10:
>
>  SELECT FLOOR(EXTRACT(EPOCH FROM NOW()) * 100000)::bigint;
>
> The problem is that NOW() does not change within a transaction and
> so I keep getting the same value.  Is there a function that will
> return a timestamp that is NOT consistent within a transaction?

Take a look at statement_timestamp() or clock_timestamp()

Cheers,
   Steve


pgsql-general by date:

Previous
From: "D. Dante Lorenso"
Date:
Subject: Need timestamp function that will change within a transaction
Next
From: Andy Anderson
Date:
Subject: Re: rounding problems