Re: Precedence of %

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Precedence of %
Дата
Msg-id 23326.1117859855@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Precedence of %  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Precedence of %  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
> Does anyone understand why the precedence of % is strange:
>     test=> select -25 % -10;

It's treating it as ((-25) %) - (10), which is probably not so
surprising given the relative precedence of % and - ... though
I have to admit I'm not totally clear why it's not (-(25 %)) - (10)
instead.

We could maybe hack the precedence of the productions for prefix/postfix
%, but I wonder if it wouldn't be smarter to remove 'em altogether
(along with the two existing unary % operators).
        regards, tom lane


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

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: need help
Следующее
От: Hans-Jürgen Schönig
Дата:
Сообщение: Re: executing OS programs from pg