I have found an issue in grammar which doesn't allow to construct
complex expressions (usage of CASEs as operands) without parentheses.
I fixed and simplified a grammar a little bit. The rest of the patch is
the same.
--
Aleksandr Parfenov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company