Re: timestamp problem

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Glaesemann <grzm(at)seespotcode(dot)net>
Cc: "Wright, George" <George(dot)Wright(at)infimatic(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: timestamp problem
Date: 2007-10-31 21:43:01
Message-ID: 21231.1193866981@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Michael Glaesemann <grzm(at)seespotcode(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Phillip Smith 2007-10-31 23:25:58 Re: What data type best used for money
Previous Message Tom Lane 2007-10-31 19:51:55 Re: timestamp problem