Re: Precedence of standard comparison operators

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Precedence of standard comparison operators
Дата
Msg-id 1197458545.112014.1426112379999.JavaMail.yahoo@mail.yahoo.com
обсуждение исходный текст
Ответ на Re: Precedence of standard comparison operators  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Precedence of standard comparison operators  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Precedence of standard comparison operators  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Robert Haas <robertmhaas@gmail.com> wrote:

> Can you, or can anyone, show a plausible example of something
> that would work under the old rules and work under the new rules
> but with a different meaning?  I have to admit that I'm having
> some difficulty imagining exactly when that happens.  Tom's
> examples upthread were not things that seemed all that likely.

I think very few will see any problems.  At Wisconsin Courts we had
millions of lines of code when we moved to PostgreSQL and saw one
or two queries which had problems with this.  The example I gave
earlier on this thread was:

| test=# select 'f'::boolean = 'f'::boolean >= 'f'::boolean;
| ?column?
| ----------
| f
| (1 row)

Now, that was a simple case for purposes of illustration, but
imagine that the first two literals are column names in a complex
query and it becomes slightly less ridiculous.  Imagine they are
being passed in to some plpgsql function which accepts different
types, and the statement is run through EXECUTE and it may be
somewhat reasonable.

The upshot is that for at least 99% of shops turning this on will
not generate any warnings at all.  So, the question is what is
better for the cases where it will actually matter?

Either way it is like leaving the barn door open so that horses are
capable of running out.  We have an alarm that lets you know when
something is going through the barn door; the question is whether
to default that alarm on or off.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: using CustomScan to inject nodes into the plan
Следующее
От: Jeff Janes
Дата:
Сообщение: Re: procost for to_tsvector