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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: A creepy story about dates. How to prevent it?
Дата
Msg-id 4028.1055968917@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: A creepy story about dates. How to prevent it?  ("scott.marlowe" <scott.marlowe@ihs.com>)
Ответы Re: A creepy story about dates. How to prevent it?  ("scott.marlowe" <scott.marlowe@ihs.com>)
Список pgsql-general
"scott.marlowe" <scott.marlowe@ihs.com> writes:
> IMHO it is a bug.  We don't let postgresql "guess" about a lot of more
> obvious things (i.e. int4 to int8 casting, etc...) and letting it guess
> about dates makes it non-ACID compliant.

How do you arrive at that conclusion?

> If it isn't a bug, how do I implement a check constraint to stop it from
> happening?  I'd like to know my database accepts properly formatted input
> and rejects the rest.  That's what the C in ACID means, right?

Do the checking in your application.  Something you think is improperly
formatted probably shouldn't get to the database in the first place.
If you aren't doing any format checking at all, you're possibly
vulnerable to SQL injection attacks.

I do now seem to recall an agreement that a GUC switch to disable
date-interpretation guessing would be okay, though.

            regards, tom lane

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

Предыдущее
От: Michael Meskes
Дата:
Сообщение: Re: postgreSQL on NAS/SAN?
Следующее
От: "Sander Steffann"
Дата:
Сообщение: Re: plpython? (Was: Re: Damn triggers and NEW)