title: Postgresql subquery no function matches the given name and argument types
body: <p>i have mysql query and running well, but when i change to postgresql my query have error.</p>
  <pre><code>SELECT 
      A.ID AS parentid,
      A.caption AS parent,
      A.link,
      b.ID,
      b.caption AS child,
      b.link,
  IF((SELECT COUNT ( be_priviledge.ID ) FROM be_priviledge WHERE role_id = 1 AND parent_id = A.ID AND child_id = b.ID ) &gt; 0,
          CONCAT ( '...' ),
      IF(to_number(SELECT COUNT( be_priviledge.ID ) 
              FROM
                  be_priviledge
                  JOIN be_menu_parent ON be_priviledge.parent_id = be_menu_parent.ID 
              WHERE
                  role_id = 1 
                  AND parent_id = A.ID 
                  AND isparent = 'N' 
              ) &gt; 0,
              CONCAT ( '...' ),
              CONCAT ( '...' ) 
          ) 
      ) AS cek 
  FROM
      be_menu_parent
      AS A LEFT JOIN be_menu_child AS b ON A.ID = b.parent_id 
  WHERE
      A.ismenu = 'Y' 
  ORDER BY
      A.ID,
      b.ID ASC
  </code></pre>
  <p>the error is</p>
  <blockquote> 
  LINE 10:  IF((SELECT COUNT( be_priviledge.ID ) 
            ^
  HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
  </blockquote>
  <p>i am new with postgresql, i search about this error but always on create function</p>