pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: CoL <col@mportal.hu>
To: pgsql-sql@postgresql.org
Subject: Re: Validity check in to_date?
Date: Tue, 02 Dec 2003 11:17:52 +0100
Message-ID: <bqhor7$1v1q$1@news.hub.org> (raw)
In-Reply-To: <20031127141125.GC87728@dyatel.antar.bryansk.ru>
References: <20031127141125.GC87728@dyatel.antar.bryansk.ru>

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



view thread (11+ messages)  latest in thread

Message-ID: <bqhor7$1v1q$1@news.hub.org>
Permalink:  ../bqhor7$1v1q$1@news.hub.org/
Also on:    postgresql.org/message-id/bqhor7$1v1q$1@news.hub.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: col@mportal.hu
  Subject: Re: Validity check in to_date?
  In-Reply-To: <bqhor7$1v1q$1@news.hub.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox