Re: Freezing localtimestamp and other time function on some value - Mailing list pgsql-general

From Petr Korobeinikov
Subject Re: Freezing localtimestamp and other time function on some value
Date
Msg-id CAJL5ff9Jk7iV5veaMLHF=c1VGH9xDujxDER7YPPoutBNMgX50Q@mail.gmail.com
Whole thread Raw
In response to Freezing localtimestamp and other time function on some value  (Alex Ignatov <a.ignatov@postgrespro.ru>)
List pgsql-general
2016-04-12 13:50 GMT+03:00 Alex Ignatov <a.ignatov@postgrespro.ru>:
Hello!
Is there any method to freeze localtimestamp and other time function value.
Say after freezing on some value sequential calls to these functions give you the same value over and over again.
This  is useful primarily for testing.

Hello!

I hope, the following snippet will be helpful.
```
begin;
select now(), current_timestamp, clock_timestamp();
select pg_sleep(5);
select now(), current_timestamp, clock_timestamp();
commit;
```

pgsql-general by date:

Previous
From: Alex Ignatov
Date:
Subject: Freezing localtimestamp and other time function on some value
Next
From: Pavel Stehule
Date:
Subject: Re: Freezing localtimestamp and other time function on some value