PostgreSQL TRANSACTION TIMESTAMP Function

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PostgreSQL TRANSACTION_TIMESTAMP() function

TRANSACTION_TIMESTAMP() function

This function is used to get current date and time (start of current transaction)

Syntax :

timeofday()

Return Type : text

PostgreSQL Version : 9.3

Pictorial Presentation of PostgreSQL TRANSACTION_TIMESTAMP() function

Example : PostgreSQL TRANSACTION_TIMESTAMP() function

SELECT timeofday();

Output :

   transaction_timestamp
----------------------------
 2015-01-15 14:57:22.598-08
(1 row)

N.B. - The outputs may change during the execution for the current date.