Re: A creepy story about dates. How to prevent it?

Поиск
Список
Период
Сортировка
От Ron Johnson
Тема Re: A creepy story about dates. How to prevent it?
Дата
Msg-id 1056024102.589.103.camel@haggis
обсуждение исходный текст
Ответ на Re: A creepy story about dates. How to prevent it?  (Bruno Wolff III <bruno@wolff.to>)
Ответы Re: A creepy story about dates. How to prevent it?  (Jonathan Bartlett <johnnyb@eskimo.com>)
Список pgsql-general
On Thu, 2003-06-19 at 05:35, Bruno Wolff III wrote:
> On Thu, Jun 19, 2003 at 02:43:12 -0500,
>   Ron Johnson <ron.l.johnson@cox.net> wrote:
> >
> > OTOH, Andrew Snow's method (alway use ANSI standard YYYY-MM-DD)
> > is guaranteed to work.  Have your app convert to that format before
> > inserting, and then PostgreSQL is guaranteed to puke if there's
> > a problem.
>
> No it isn't. In 7.4:
> area=> select '2003-20-02'::date;
>     date
> ------------
>  2003-02-20
> (1 row)

Whoa...

It shouldn't be difficult, though, to create a function to validate
dates, and have it be an implicit CHECK on date fields.  Should it?

--
+-----------------------------------------------------------+
| Ron Johnson, Jr.     Home: ron.l.johnson@cox.net          |
| Jefferson, LA  USA   http://members.cox.net/ron.l.johnson |
|                                                           |
| "Oh, great altar of passive entertainment, bestow upon me |
|  thy discordant images at such speed as to render linear  |
|  thought impossible" (Calvin, regarding TV)               |
+-----------------------------------------------------------


В списке pgsql-general по дате отправления:

Предыдущее
От: Justin Clift
Дата:
Сообщение: [Fwd: PostGreSQL information]
Следующее
От: Thierry Missimilly
Дата:
Сообщение: Try to connect