title: Greenplum issue : function cannot execute on segment because it accesses relation
body: <p>I am using a Greenplum database. Below is the function definition which I used to execute.</p>
  <pre><code>CREATE OR REPLACE FUNCTION testfunc(IN id int, OUT rate double precision)
  RETURNS double precision AS
  $BODY$
  begin
  select count(*) into rate from ref_test_V
  return;
  end;
  $BODY$
    LANGUAGE plpgsql VOLATILE;
  </code></pre>
  <p>And when I call this function in the select list it throwing me below error</p>
  <p><strong>Query:</strong> select 1,testfunc(id) from ref_test</p>
  <p><strong>ERROR:</strong> XX000: function cannot execute on segment because it accesses relation &quot;public.ref_test_v&quot; (functions.c:155)  (seg25 slice1 *****.com 1026 pid=193132) (cdbdisp.c:1326)</p>