dingus

/ˈdɪŋəs/ Something whose name is unknown or forgotten

CURRENT_TIMESTAMP

February 2022

Turns out calling CURRENT_TIMESTAMP within a transaction will always return the time the transaction began1. In my mental model I’d always thought of it being the clock time for the statement.

Postgres aliases CURRENT_TIMESTAMP to transaction_timestamp() which is a more intention revealing name. There’s also the well named clock_timestamp() and statement_timestamp(), both of which simply do what-it-says-on-the-tin.