Re: Precedence of standard comparison operators
От | Kevin Grittner |
---|---|
Тема | Re: Precedence of standard comparison operators |
Дата | |
Msg-id | 417902218.2905484.1424451583464.JavaMail.yahoo@mail.yahoo.com обсуждение исходный текст |
Ответ на | Re: Precedence of standard comparison operators (Tom Lane <tgl@sss.pgh.pa.us>) |
Ответы |
Re: Precedence of standard comparison operators
Re: Precedence of standard comparison operators |
Список | pgsql-hackers |
Tom Lane <tgl@sss.pgh.pa.us> wrote: > Kevin Grittner <kgrittn@ymail.com> writes: >> Tom Lane <tgl@sss.pgh.pa.us> wrote: >>> the precedence of <= >= and <> is neither sane nor standards compliant. >> I wonder whether it would be feasible to have an option to generate >> warnings (or maybe just LOG level messages?) for queries where the >> results could differ. > > My guess (admittedly not yet based on much) is that warnings won't be too > necessary. If a construction is parsed differently than before, you'll > get no-such-operator gripes. I have a memory of running into this in real-world production code and that it involved booleans. I'll see whether I posted something to the community lists about it, but it didn't take long to produce an (admittedly artificial) case where incorrect results are silently returned: test=# select 'f'::boolean = 'f'::boolean >= 'f'::boolean; ?column? ---------- f (1 row) test=# select 'f'::boolean >= 'f'::boolean >= 'f'::boolean; ?column? ---------- t (1 row) -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
В списке pgsql-hackers по дате отправления: