"Marek Lewczuk" <newsy@lewczuk.com> writes:
> CREATE FUNCTION "public"."test" (text, text) RETURNS text AS'
> BEGIN
> IF $1 THEN
> RETURN $1;
> ELSE
> RETURN $2;
> END IF;
> END;
> 'LANGUAGE 'plpgsql' VOLATILE CALLED ON NULL INPUT SECURITY INVOKER;
If there's a bug here at all, it's that this function doesn't report a
type violation. What in the world do you think the semantics of that
IF-test are? text is not boolean.
regards, tom lane