CREATE OR REPLACE FUNCTION public.iif(
    boolean,
    character varying,
    character varying)
  RETURNS character varying AS
$BODY$
declare 
valaszertek character varying;
begin 
   if ($1) then
      valaszertek := $2;
   else
      valaszertek := $3;
   end if;
  return valaszertek; 
end; $BODY$
  LANGUAGE plpgsql VOLATILE
  COST 100;