Re: Dates with unknown month and/or day

From: Sean Davis <sdavis2(at)mail(dot)nih(dot)gov>
To: Christoph Della Valle <christoph(dot)dellavalle(at)goetheanum(dot)ch>
Cc: pgnovice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Dates with unknown month and/or day
Date: 2007-11-05 17:41:31
Message-ID: 472F55CB.3030208@mail.nih.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Christoph Della Valle wrote:
> Hi
>
> I think it is not a very good idea to fill unknown parts of a date with
> '1's, unless you introduce a new attribute "precision" or so, where you
> store which part (y for year only, m for year/month etc) of your date
> really can be taken seriously...
>
> Or you store year/month/day separately. When you want to use a date
> function, you concatenate all parts and cast it as a date. This is clean
> but more complicated. It depends, how often you need date-functions.
> Attention: concatenation with NULL results in NULL, so you need to use
> coalesce.

Thanks, Chris. This is what I suspected.

Sean

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Nick Nick 2007-11-06 07:55:47 Re: Dates with unknown month and/or day
Previous Message Christoph Della Valle 2007-11-05 17:37:35 Re: Dates with unknown month and/or day