Re: Working with dates before 4713 BC

From: "Phillip Smith" <phillip(dot)smith(at)weatherbeeta(dot)com(dot)au>
To: "'Tom Lane'" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "'Ryan Wallace'" <rywall(at)interchange(dot)ubc(dot)ca>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Working with dates before 4713 BC
Date: 2008-05-06 01:28:49
Message-ID: 00d401c8af18$896431e0$9b0014ac@wbaus090
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Do you really need microsecond, or even day, resolution in your dates? I
wonder if it'd not be good enough to store the year as an integer.

Maybe 2 columns:
date_col type date = For dates post 4713BC. Set to NULL if ealier than
4713BC.
year_col type integer = Store the year from date_col

Then write your queries appropriately to look at year_col if date_col IS
NULL?

THINK BEFORE YOU PRINT - Save paper if you don't really need to print this

*******************Confidentiality and Privilege Notice*******************

The material contained in this message is privileged and confidential to
the addressee. If you are not the addressee indicated in this message or
responsible for delivery of the message to such person, you may not copy
or deliver this message to anyone, and you should destroy it and kindly
notify the sender by reply email.

Information in this message that does not relate to the official business
of Weatherbeeta must be treated as neither given nor endorsed by Weatherbeeta.
Weatherbeeta, its employees, contractors or associates shall not be liable
for direct, indirect or consequential loss arising from transmission of this
message or any attachments
e-mail.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Sid 'Neko Tamashii' 2008-05-06 11:06:39 Database normalization
Previous Message Tom Lane 2008-05-06 01:17:24 Re: Working with dates before 4713 BC