Search Postgresql Archives

Re: Partial dates

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"Joshua D. Drake" <jd@xxxxxxxxxxxxxxxxx> writes:
>> Any suggestions (aside from designing a new datatype)?

> 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 think the right answer is that a new datatype is exactly what you
need.  SQL-spec dates are absolutely *not* meant to express these
concepts (and the fact that MySQL allows you to insert "dates" with
zero fields just shows what a lack of error checking they have).

It's really not that hard to build a new datatype in PG, especially
if you only need it to store values and not do any particularly amazing
computational feats.  Consider for instance a domain over type "text"
with appropriate constraint checks.

			regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux