There is no function DATE_SUB()
in PostgreSQL, so it cannot work.
This expression would work in Postgres:
... AND confirmation_sent_at <= (now() - interval '1 day')
Or, if confirmation_sent_at
is a date
:
... AND confirmation_sent_at <= (now()::date - 1)