Marek Lewczuk writes:
> I'm moving out from MySQL to PostgreSQL and there are some function
> which are not supported in PG so I'm trying to write my own functions.
> Currently I have big problem with function IF(), below the description
> of this function from MySQL manual.
You cannot implement this kind of function, unless you want to create one
version for each data type combination. But consider replacing the IF()
function with the standard CASE expression:
CASE WHEN expr1 THEN expr_if_true ELSE expr_if_false END
Also note that in PostgreSQL there is a boolean type, and 0 and 1 are not
valid boolean values.
--
Peter Eisentraut peter_e@gmx.net