Re: [PATCHES] binary operators on integers

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCHES] binary operators on integers
Дата
Msg-id 25906.972423039@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-hackers
Peter Eisentraut <peter_e@gmx.net> writes:
> This patch was installed, with xor as "#".  The parser still needs work.  
> Besides the known issue of "|", this also parses funny:

> => select 5 & ~ 6;
> ERROR:  Unable to identify a right operator '&' for type 'int4'

I think we're kind of stuck on that, at least in terms of a solution
specifically for ~ --- I don't think we should be wiring knowledge of
whether specific operators are prefix/suffix/infix into the grammar.

It might perhaps be possible to tweak the grammar so that
operand operator operator operand

is generically resolved as
operand infix-op (prefix-op operand)

and not
(operand postfix-op) infix-op operand

the way it is now.  Given that postfix operators are relatively seldom
used, this seems a more sensible default --- but I suppose somewhere out
there is an application that will break.  (At least it probably won't
break silently.)

Comments anyone?
        regards, tom lane


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

Предыдущее
От: richard excite
Дата:
Сообщение: Re: Two-phase commit
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: how to access backend pid from libpq ?