Re: Is there a way to change current time?

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: "Warstone(at)list(dot)ru" <warstone(at)list(dot)ru>
Cc: "pgsql-performance(at)lists(dot)postgresql(dot)org" <pgsql-performance(at)lists(dot)postgresql(dot)org>
Subject: Re: Is there a way to change current time?
Date: 2021-04-15 14:14:27
Message-ID: CAFj8pRBb-G2_Afh+tDGEeoACqXSK_0ZakuH_pp-zG5bGKTrjgA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Hi

čt 15. 4. 2021 v 15:45 odesílatel Warstone(at)list(dot)ru <warstone(at)list(dot)ru>
napsal:

> Hi,
>
> Is there any way to set time that CURRENT_TIMESTAMP and/or now() will give
> next time? (We need it only for testing purposes so if there is any hack,
> cheat, etc. It will be fine)
>

This is a bad way - don't use now() in queries - use a variable instead.
Later you can use now as an argument or some constant value.

Regards

Pavel

>
>
>
>
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Eugene Pazhitnov 2021-04-15 14:37:17 Re: Is there a way to change current time?
Previous Message Tom Lane 2021-04-15 14:13:33 Re: Is there a way to change current time?