Re: Freezing localtimestamp and other time function on some value

Поиск
Список
Период
Сортировка
От Petr Korobeinikov
Тема Re: Freezing localtimestamp and other time function on some value
Дата
Msg-id CAJL5ff9Jk7iV5veaMLHF=c1VGH9xDujxDER7YPPoutBNMgX50Q@mail.gmail.com
обсуждение исходный текст
Ответ на Freezing localtimestamp and other time function on some value  (Alex Ignatov <a.ignatov@postgrespro.ru>)
Список 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 по дате отправления:

Предыдущее
От: Alex Ignatov
Дата:
Сообщение: Freezing localtimestamp and other time function on some value
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Freezing localtimestamp and other time function on some value