Re: [HACKERS] Cast has higher precedence than -

2015-05-03 Thread Tom Lane
Jim Nasby writes: > The problem is that :: binds more tightly than - This is well known, and even well documented. > Is this by design? If not, any ideas how bad it'd be to fix? It is by design. The core argument for doing it is that '-' might have type-dependent semantics that would not be re

[HACKERS] Cast has higher precedence than -

2015-05-03 Thread Jim Nasby
Given this domain... CREATE DOMAIN loan.loan_amount numeric(7,2) --loan.loan_amount_raw CONSTRAINT loan_amount__greater_equal_0 CHECK( VALUE >= 0 ) CONSTRAINT loan_amount__less_equal_2 CHECK( VALUE <= 2 ) ; I was rather surprised by select -1::loan.loan_amount; ?column?