Re: Partial dates

From: Joe <svn(at)freedomcircle(dot)net>
To: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Partial dates
Date: 2005-09-14 04:09:58
Message-ID: 4327A296.80902@freedomcircle.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joshua D. Drake wrote:
> 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.

I'm not sure I agree with the need to "fix" or "sanitize" the data. The columns
in question are used mostly for publication dates. While you may be able to
find a full release date for recent books, they are generally listed as
published on a given year, period. Most monthly magazines only have a
month-year of publication. And of course, daily newspapers and Internet
articles usually have a full day-month-year. In fact, the MySQL solution didn't
address quarterly or bi-monthly publications as that data was only captured as
one of the months in the period--as opposed to Mar/Apr 2005 or First Quarter
2005 (or worse: Winter 2004). As Tom Lane argued, it seems I'll have to bite the
bullet and create a new datatype. The only other alternative I see would be to
split the publication date into three columns and that's rather ugly.

Thanks for the feedback.

Joe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Brent Wood 2005-09-14 04:11:25 Howto create a plperlu function as user (not superuser)??
Previous Message Tom Lane 2005-09-14 03:50:15 Re: Partial dates