Postgres offers many math
functions including
abs
for computing the absolute value of a number.
> select abs(-1);
abs
-----
1
(1 row)
There is also an absolute value operator -- the @
symbol. This can be used
to do the same thing.
> select @ -1;
?column?
----------
1
(1 row)