Re: timestamp problem
От | Tom Lane |
---|---|
Тема | Re: timestamp problem |
Дата | |
Msg-id | 21231.1193866981@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: timestamp problem (Michael Glaesemann <grzm@seespotcode.net>) |
Список | pgsql-novice |
Michael Glaesemann <grzm@seespotcode.net> writes: > On Oct 31, 2007, at 12:40 , Wright, George wrote: >> In the temporal section it mentions >> Function Returns >> isfinite(col) BOOLEAN indicating whether col is a valid date. > I'd argue that this has always been wrong, but my PostgreSQL > knowledge doesn't extend quite that far back. Yeah, the definition of the function has always been the same as it is now: it just checks for the special timestamp values "+infinity" and "-infinity". If you cross your eyes suitably maybe you could make an argument that the above description is not incorrect, but I'd agree that it's not very good. >> Is there a calendar validation routine in PostGreSQL? I didn't see one >> in the \df listing. > Depends on what you mean by calendar validation. For the specific > case you've been interested in, I doubt it, though you could probably > cobble one together using a procedural language. Maybe PL/perlu and > some Perl libraries would help you out. In the Postgres design, the sort of validation George is interested in is done by the timestamp datatype's input routine: anything that has managed to get stored in the database is a valid value, by definition. So a "validation test" would consist of something like trying to cast a string to timestamp and seeing if it throws an error. Unfortunately, there's no provision for "I disagree with this datatype's validation rules", other than writing your own datatype or hacking the source code... regards, tom lane
В списке pgsql-novice по дате отправления: