title: How to write a function that returns text or integer values?
body: <p>I'm using PostgreSQL 9.2.4.</p>
  
  <p>postgres=# select version();</p>
  
  <pre><code>                           version
  -------------------------------------------------------------
   PostgreSQL 9.2.4, compiled by Visual C++ build 1600, 64-bit
  (1 row)
  </code></pre>
  
  <p><a href="http://sqlfiddle.com/#!12/67bf6/3" rel="nofollow">sqlfiddle link</a></p>
  
  <p>My Query executes the insertion safely. What i need is that my function should return something except the void datatype. Something like text("inserted into table") or integer(0-false,1-true) , it will be useful for me to validate whether it is inserted or not?</p>
  
  <p>I need a syntax for a function that returns an <code>integer</code> or a <code>text</code> when an insertion is done. For validation purpose. Is there any way to solve this?</p>