Re: Finding bogus dates
От | A. Kretschmer |
---|---|
Тема | Re: Finding bogus dates |
Дата | |
Msg-id | 20070118193823.GA16764@a-kretschmer.de обсуждение исходный текст |
Ответ на | Finding bogus dates (Scott Ribe <scott_ribe@killerbytes.com>) |
Список | pgsql-general |
am Thu, dem 18.01.2007, um 11:26:03 -0700 mailte Scott Ribe folgendes: > Suppose that I have a varchar column which contains dates, and some of them > are bogus, such as '1968-02-31'. Is it possible to specify a query condition > "cannot be cast to a valid date". (It's legacy data, and I'm trying to clean > it up before importing into the final schema.) There probably aren't that > many, and I can just keep hitting pg errors one row at a time until I work > through this, but... You can write a function for this, read this chapter in the docu about trapping errors: http://www.postgresql.org/docs/8.2/interactive/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
В списке pgsql-general по дате отправления: