Reputation: 272
I essentially want to run a query like:
SELECT * FROM t where date={time right now to the minute}
Upvotes: 0
Views: 971
Reputation: 1269593
Use date_trunc()
for your exact question:
where date = date_trunc('minute', now())
However, I suspect you really want the span of one minute:
where date >= date_trunc('minute', now()) and
date < date_trunc('minute', now()) + interval '1 minute'
Upvotes: 4