Re: Partial dates
От | Tom Lane |
---|---|
Тема | Re: Partial dates |
Дата | |
Msg-id | 28925.1126669815@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: Partial dates ("Joshua D. Drake" <jd@commandprompt.com>) |
Список | pgsql-general |
"Joshua D. Drake" <jd@commandprompt.com> 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
В списке pgsql-general по дате отправления: