title: referencing parameters on stored procedures in PostgreSQL
body: <p>I'm Converting some SQLServer stored procedures and I have a problem that I can't solve.
  That's SQLServer function:</p>
  
  <pre><code>CREATE FUNCTION [dbo].[getViewNodeHierarchyAux](@pivot varchar(255), @parents varchar(max))
  RETURNS @view TABLE (PARENT_OID varchar(255), CHILD_OID varchar(255))
  ...
  insert into @view select F.* from BTREENODES_NODEHIERARCHY T cross apply [dbo].getViewNodeHierarchyAux(T.CHILD_OID,@parents) F where T.PARENT_OID=@pivot;
  </code></pre>
  
  <p>And that's the conversion I have thought in PostgreSQL:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION getviewnodehierarchyauxprueba(IN pivot character varying, IN parents character varying)
  ...
    RETURNS TABLE(test_parent_oid character varying, test_child_oid character varying)
  return query (select F.* from BTREENODES_NODEHIERARCHY T cross join getviewnodehierarchyprueba(T.CHILD_OID,parents) F WHERE T.PARENT_OID=pivot);
  </code></pre>
  
  <p>PgAdmin tells me that there's no valid reference to table 't' in 'from' clause. And if I write it this way 
  <code>getviewnodehierarchyprueba((select CHILD_OID from BTREENODES_NODEHIERARCHY),parents)</code></p>
  
  <p>It returns more than one record and it doesn't work. Any ideas? thank you! </p>