Re: PG not rejecting bad dates (was Re: Finding bogus dates)

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: PG not rejecting bad dates (was Re: Finding bogus dates)
Дата
Msg-id 20070119000656.GI23996@fetter.org
обсуждение исходный текст
Ответ на Re: PG not rejecting bad dates (was Re: Finding bogus dates)  (Ron Johnson <ron.l.johnson@cox.net>)
Ответы Re: PG not rejecting bad dates (was Re: Finding bogus  (Scott Ribe <scott_ribe@killerbytes.com>)
Список pgsql-general
On Thu, Jan 18, 2007 at 06:05:37PM -0600, Ron Johnson wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On 01/18/07 17:52, David Fetter wrote:
> > On Thu, Jan 18, 2007 at 05:42:54PM -0600, Ron Johnson wrote:
> >>
> >> On 01/18/07 17:22, Scott Ribe wrote:
> >>>> But this won't work if one had a text column of dates in various
> >>>> formats, right?
> >>> Right. In my case I have bad data from a source I didn't control, exported
> >>> via code that I do control which happens to output YYYY-MM-DD. Well, except
> >>> that I don't do what I need to when MM or DD are more than 2 digits, but I'm
> >>> going back to look at that again ;-)
> >> Why didn't the PG engine reject these bad-date records at INSERT
> >> time.  This smacks of something that MySQL would do...
> >
> > I'm pretty sure it didn't accept these as bad dates, but as text
> > strings.  As you point out, it's a MySQLism to take "we are all here
> > to go into space" as a valid date.
>
> Ah, the relevant snippet from OP:
> > I have a varchar column
>
> That would explain everything.  Except why it's a VARCHAR instead of
> DATE.  But that's a whole 'nother discussion.

As I understood OP, it's a staging table :)

Cheers,
D
--
David Fetter <david@fetter.org> http://fetter.org/
phone: +1 415 235 3778        AIM: dfetter666
                              Skype: davidfetter

Remember to vote!

В списке pgsql-general по дате отправления:

Предыдущее
От: Clodoaldo
Дата:
Сообщение: Re: Spam from EnterpriseDB?
Следующее
От: Jorge Godoy
Дата:
Сообщение: Re: Spam from EnterpriseDB?