From: | "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com> |
---|---|
To: | Joe <svn(at)freedomcircle(dot)net> |
Cc: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
Subject: | Re: Partial dates |
Date: | 2005-09-14 03:19:03 |
Message-ID: | 432796A7.30607@commandprompt.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
>
> ERROR: date/time field value out of range: "1997-10-00"
> HINT: Perhaps you need a different "datestyle" setting.
> CONTEXT: COPY Entry, line 1, column EntryDate: "1997-10-00"
>
> I read Appendix B and section 8.5, but I didn't find any way around
> this, i.e., it seems Postgres insists on complete dates with no zero
> day of month or month. Changing the zeros to ones would be major
> editing task and the application code would still have trouble
> distinguishing whether 2005-03-01 meant March 2005 (a monthly
> publication date) or 1st March 2005 (a date of an article published on
> that date or of a weekly periodical) (because right now it interprets
> the zero day of month as the former). Any suggestions (aside from
> designing a new datatype)?
Well the easy solution is to just make the date a text type but that is
the wrong answer. The right answer is to fix the data set.
MySQL should never have allowed you do insert those dates in the first
place. I know that doesn't help you much but at some point
you are going to have to sanitize the data anyway.
Sincerely,
Joshua D. Drake
>
>
> Joe
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
--
Your PostgreSQL solutions company - Command Prompt, Inc. 1.800.492.2240
PostgreSQL Replication, Consulting, Custom Programming, 24x7 support
Managed Services, Shared and Dedicated Hosting
Co-Authors: plPHP, plPerlNG - http://www.commandprompt.com/
From | Date | Subject | |
---|---|---|---|
Next Message | Brent Wood | 2005-09-14 03:49:29 | Re: Partial dates |
Previous Message | Tom Lane | 2005-09-14 02:37:49 | Re: oracle's first_value function for postgres? |