Re: Unary Operators

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andreas Ulbrich <andreas(dot)ulbrich(at)matheversum(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Unary Operators
Date: 2013-11-09 01:51:59
Message-ID: 2550.1383961919@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andreas Ulbrich <andreas(dot)ulbrich(at)matheversum(dot)de> writes:
> In the documentation I can't find, that / is not possible as an unary
> operator.
> Are there any restrictions.

Yeah, if you look in the bison grammar you'll find out that the operators
with special precedence are hard-wired as to which syntaxes are allowed:

+ - prefix or infix
* / % ^ < > = infix only

It's possible that if we just added some more productions these could be
used in nonstandard ways. But I think interest in that is really pretty
low, and it might lead to behavior that would be surprising to people
who aren't interested in using them in weird ways.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sandeep Gupta 2013-11-09 03:16:40 what could cause postgres to crash?
Previous Message Sergey Konoplev 2013-11-08 20:24:34 Re: database redesign