How to add dates to psql dev data code example
Example 1: today minus 15 days postgresql
--yesterday
SELECT NOW() - INTERVAL '1 DAY';
--Unrelated to the question, but PostgreSQL also supports some shortcuts:
SELECT 'yesterday'::TIMESTAMP, 'tomorrow'::TIMESTAMP, 'allballs'::TIME;
Example 2: substract variable amount of minutes from timestamp postgresql
SELECT p.date_time + number_of_seconds * INTERVAL '1 second'
FROM photo p
WHERE p.id = 1;