Re: [GENERAL] Date Time data types - Mailing list pgsql-general

From Murtuza Zabuawala
Subject Re: [GENERAL] Date Time data types
Date
Msg-id CAKKotZQXnuTMkq+jdRbKYkT0=FdufoHiKhz9o01_nKrW1zFQZA@mail.gmail.com
Whole thread Raw
In response to [GENERAL] Date Time data types  (Brahmam Eswar <brahmam1234@gmail.com>)
List pgsql-general
As per my knowledge,

CLOCK_TIMESTAMP value changes every time you call it even in the same transaction

BEGIN
  ...
  CLOCK_TIMESTAMP()  -- Gives 2017-11-23 15:02:27.492867+05:30
  ...
  ...
  CLOCK_TIMESTAMP()  -- Gives different time as per current clock time
  ...
END;


CURRENT_TIMESTAMP 
​is the time of ​
start of current transaction
​ and does not change in the same transaction.​


BEGIN
  ...
  CURRENT_TIMESTAMP() -- Gives 2017-11-23 15:01:40.171462+05:30
  ...
  ...
  CURRENT_TIMESTAMP() -- Gives same time as previous call
  ...
END;


​-- Murtuza​


On Thu, Nov 23, 2017 at 2:29 PM, Brahmam Eswar <brahmam1234@gmail.com> wrote:
What is difference between CLOCK_TIMESTAMP() and CURRENT_TIMESTAMP?

Is there any specific use case to differentiate them .
--
Thanks & Regards,
Brahmeswara Rao J.

pgsql-general by date:

Previous
From: Brahmam Eswar
Date:
Subject: [GENERAL] Date Time data types
Next
From: Brahmam Eswar
Date:
Subject: [GENERAL] Multiple key error .