title: what is the meaning of this postgres error: "ROWS is not applicable when function does not return a set"
body: <p>I am new to postgres and getting an error that I can't seem to find on Stackoverflow (?). I am trying to write a function that returns true when a person is qualified for a job and false if they are not. This raises "ERROR: ROWS is not applicable when function does not return a set." <a href="http://www.forosdelweb.com/f99/error-definir-funcion-946980/" rel="noreferrer">Found some stuff in spanish</a>--but nothing on SO. Can someone explain this one?</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION "isPersonQualifiedForJob"(pid integer, jid integer)
    RETURNS bit AS
  '
          IF 
          (SELECT count(*) FROM "getSkillsForJob"("jid") "j" WHERE 
          NOT EXISTS ( 
                      SELECT 1 FROM "getSkillsForPerson"("pid") "p" WHERE "j"."SkillID"="p"."SkillID" 
                     )
          )&gt; 0 
          THEN 
             return 0;
          ELSE
             return 1;
          END IF;
  '
    LANGUAGE sql VOLATILE
    COST 100
    ROWS 1000;
  ALTER FUNCTION "isPersonQualifiedForJob"(integer)
    OWNER TO postgres; 
  </code></pre>