Re: Freezing localtimestamp and other time function on some value

From: George Neuner <gneuner2(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Freezing localtimestamp and other time function on some value
Date: 2016-04-12 13:57:40
Message-ID: mrupgbd1b6s9fdatp28co76giicnnqjo2p@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, 12 Apr 2016 13:50:11 +0300, Alex Ignatov
<a(dot)ignatov(at)postgrespro(dot)ru> wrote:

>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.
>
>In oracle there is alter system set fixed_date command. Have Postgres
>this functionality?

I'm missing how this is useful. Even having such a feature there is
not any way to duplicate a test trace: execution time of a request is
not guaranteed even if it's issue time is repeatable wrt some epoch.
And if there are concurrent requests, their completion order is not
guaranteed.

It is also true in Oracle, and in every general purpose DBMS that I
know of. So what exactly do you "test" using a fixed date/time?

George

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alexander Pyhalov 2016-04-12 14:02:49 Re: pgpool-II: cannot use serializable mode in a hot standby
Previous Message Adrian Klaver 2016-04-12 13:50:27 Re: pgpool-II: cannot use serializable mode in a hot standby