Re: Partial dates

From: Gnanavel S <s(dot)gnanavel(at)gmail(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 05:15:07
Message-ID: eec3b03c0509132215139ca9c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 9/14/05, Joe <svn(at)freedomcircle(dot)net> wrote:
>
> 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
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>

probably you can add a new column to identify the publication type and
sanitize the wrong dates ( like 2005-00-00 to 2005-01-01). Now based on the
publication type you can extract the portion of the date you want.

--
with regards,
S.Gnanavel
Satyam Computer Services Ltd.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2005-09-14 06:17:49 Re: MS SQL - PostgreSQL
Previous Message Dann Corbit 2005-09-14 04:20:34 Re: MS SQL - PostgreSQL