Does PostgreSQL have a constant (like MAXFLOAT in Objective-C) for the maximum value that a smallint
can be?
I know the PostgreSQL numeric types documentation says it's 32767
, but I'd rather use a constant than hard coding a value that could change.
I'm using this number to prevent an error when incrementing a smallint
, e.g.:
UPDATE populations
SET count = count + 1
WHERE city_id = 3
AND count < 32767;