Re: Validity check in to_date?

From: CoL <col(at)mportal(dot)hu>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Validity check in to_date?
Date: 2003-12-02 10:17:52
Message-ID: bqhor7$1v1q$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

hi,

SELECT isfinite(timestamp '123.45.2003'); if this is true, the date is
ok, if error, than not :)

C.

Alexander M. Pravking wrote:

> I just discovered that to_date() function does not check if supplied
> date is correct, giving surprising (at least for me) results:
>
> fduch=# SELECT to_date('31.11.2003', 'DD.MM.YYYY');
> to_date
> ------------
> 2003-12-01
>
> or even
>
> fduch=# SELECT to_date('123.45.2003', 'DD.MM.YYYY');
> to_date
> ------------
> 2007-01-03

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message CoL 2003-12-02 10:20:54 Re: XML & Postgres Functions
Previous Message Karel Zak 2003-12-02 09:57:14 Re: Validity check in to_date?