Re: Partial or incomplete dates

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: "Leif B(dot) Kristensen" <leif(at)solumslekt(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Partial or incomplete dates
Date: 2005-03-12 16:17:19
Message-ID: 20050312161719.GA22317@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Mar 12, 2005 at 11:30:03 +0100,
"Leif B. Kristensen" <leif(at)solumslekt(dot)org> wrote:
>
> In MySQL, the checking on dates is very relaxed, so it's totally legal
> to enter a date as '1731-00-00', and let your own program logic decide
> that this means just the year 1731. Do I have to make my own data type
> to store and manipulate partial dates, or has somebody already done it?
> Or is there a way to use relaxed date checking in PostgreSQL?

There is no existing datatype like that. Probably the best thing to do
is to store the year, month and day as separate integers and allow for
nulls or special codes to indicate missing data.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-03-12 16:23:17 Re: postgres 8 settings
Previous Message Mike Rylander 2005-03-12 14:22:41 Re: partitionning