title: How to find if a function exists in PostgreSQL and where?
body: <p>My question is similar to the headline of the question posted <a href="https://stackoverflow.com/questions/24773603/how-to-find-if-a-function-exists-in-postgresql">here</a> However the answer there are different and much more complex than what I need.</p>
  
  <p>My problem is simple... I have a function name say <code>func1</code> and I would like to know if and where this function was implemented. Get it's location, it's arguments and it's code. I've tried to build one using <code>pg_proc</code> :</p>
  
  <pre><code>select proname,prosrc from pg_proc where proname like 'func1';
  </code></pre>
  
  <p>How do I add schema name, function code (text) , and function argument list?</p>
  
  <p>Another issue which is curious to me... Can I make it work if instead of <code>func1</code> I'll search <code>lower</code>? lower is a <a href="http://www.postgresql.org/docs/9.1/static/functions-string.html" rel="nofollow noreferrer">build in function</a>  which is not implemented by the user. </p>
  
  <p><strong>The <a href="https://stackoverflow.com/questions/6898453">question</a> do not address my whole problem</strong>. as it doesn't explain how do get in what schema the function is defined nor if it will work on functions which are build in SQL standard like lower(string).</p>