Brendan Jurd <direvus@gmail.com> writes:
> Regarding the statement_timestamp() ... if the entire query path is
> parser -> rewriter -> planner/optimiser -> executor, what point in
> that path would be considered the true start of the "statement"?
IIRC, what we actually intended that to mean is the time of receipt of
the current interactive command --- that is, it gets set in the
postgres.c outer loop, not anywhere in the parser/etc path. Otherwise
there's not a unique answer (consider statements issued inside SQL
functions for instance).
regards, tom lane