PostgreSQL vs MySQL timestamp calculation in a transaction

Опубликовано: 19 Февраль 2026
на канале: Maysam Senaps
266
5

Have you ever had the question of in a transaction, when MySQL or PostgreSQL inserts data into a table and has a field which has a default value of NOW() for a timestamp field, when is it calculating the timestamp to be inserted? at the beginning of the transaction? when processing the column? when committing the data?
in this video, I'm going over that question and trying to answer it, in the most un-standard way possible!
spoiler alert: for PG in start of transaction and for mysql, at the processing time.