Matthew <matt@ctlno.com> writes:
> What I would like is something like this (using pseudo sql)
> select (if(col1>1) true else if (col1<= 1) false) from foo;
This particular example could be written as just
select col1>1 from foo
since a boolean result is a perfectly good result.
More generally, you could use the CASE construct for conditional
expressions. See
http://www.postgresql.org/devel-corner/docs/postgres/functions-conditional.html
regards, tom lane