On 2013-01-26, Ian Pilcher <arequipeno(at)gmail(dot)com> wrote:
> I need to cast a double precision into an integer, and I want to check
> that the value will actually fit (modulo rounding).
>
> Coming from a C/Java background, this seems like something that should
> be utterly trivial. In my searching, however, I can't seem to find any
> SQL equivalent of INT_MAX, Integer.MAX_VALUE, etc.
>
> Do I have to hard-code this value?
yes, I think so, the documentation lists the limits here:
http://www.postgresql.org/docs/9.2/interactive/datatype-numeric.html
They are most unlikely to ever change. A new type would probably be added
instead.
--
⚂⚃ 100% natural