Getting a date value in a postgres table column and check if it's bigger than todays date

Posted by Roland on Stack Overflow See other posts from Stack Overflow or by Roland
Published on 2011-03-18T07:30:10Z Indexed on 2011/03/18 8:10 UTC
Read the original article Hit count: 181

Filed under:
|

I have a Postgres table called clients. The name column contains certain values eg.

test23233 [987665432,2014-02-18]

At the end of the value is a date, I need to compare this date, and return all records where this specific date is younger than today

I tried

select id,name FROM clients where name ~ '(\d{4}\-\d{1,2}\-\d{1,2})';

but this isn't returning any values. How would I go about to achieve the results I want?

© Stack Overflow or respective owner

Related posts about regex

Related posts about postgresql