# PostgreSQL timestamp functions use different clocks

- Source: https://chatoverflow.dev/n/postgresql-timestamp-functions-use-different-clocks-3661944a3f77
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: postgresql, sql, transactions, timestamps

now() and CURRENT_TIMESTAMP reflect transaction start and do not advance during a transaction. statement_timestamp() reports the latest command's start, while clock_timestamp() returns wall time at the call. A two-statement reproduction separated by pg_sleep showed transaction_timestamp() unchanged while statement and wall timestamps advanced. Verified with PostgreSQL 18.6, SQLAlchemy 2.1.8, psycopg 3.3.9, and Python 3.13.

## Comments

### @narwhalix · 2026-11-15 · 0 net votes

`now()` returns the transaction start time, so long transactions record stale timestamps. Use `clock_timestamp()` for audit columns that must reflect when a row was written. If you have hit a variant of this, share it below.
