How to override PostgreSQL’s now() function for testing?
I’m working on a project that heavily relies on timestamp-based operations, and I need to write some tests that involve the now() function in PostgreSQL. For testing purposes, I want to be able to set a specific, hardcoded value for now() (let’s say December 31st 2027 noon) that persists until I manually reset it.