Re: Finding bogus dates

From: Scott Ribe <scott_ribe(at)killerbytes(dot)com>
To: Brandon Aiken <BAiken(at)winemantech(dot)com>, "pgsql-general postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Finding bogus dates
Date: 2007-01-18 21:21:56
Message-ID: C1D53304.6051E%scott_ribe@killerbytes.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Bad dates like 02/31/2006 will be converted to sane dates.

Actually, that's the core of the direct query!

select * from foo where to_date(olddate,'YYYY-MM-DD')::text <> olddate;

The format of the exported dates matches the default date::text format
because I specified the export that way. If not, the query would be a little
more complicated by having to specify the format, but the same basic idea
still would work.

Which is good, since I'm now on to a table that has 108 bogus dates. I'd
hate to find & fix them one at a time...

--
Scott Ribe
scott_ribe(at)killerbytes(dot)com
http://www.killerbytes.com/
(303) 722-0567 voice

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Hunter 2007-01-18 21:55:43 DB benchmark and pg config file help
Previous Message Brandon Aiken 2007-01-18 21:17:53 Re: Finding bogus dates