title: How do I store a set of queries inside PostgreSQL so I can easily run it again?
body: <p>I want to save a set of queries (multiple SQL updates) as a single element that I can execute using pgAdmin3 (PostgreSQL 9.1).</p>
  
  <p>I know that I can save single SELECTS as views but how about multiple UPDATE queries?</p>
  
  <p>Example:</p>
  
  <pre><code>BEGIN;
  UPDATE ...;
  UPDATE ...;
  COMMIT;
  </code></pre>
  
  <p>Update: What I looking for is a step-by-step guide of adding a stored procedure using the GUI, not running a SQL query that creates it.</p>
  
  <p>So far, I encountered two problems with <code>"New function..."</code>: the return type is required and found that NULL is not acceptable, so tried <code>integer</code>. Also, set the type to <code>SQL</code> but I don't know what exactly to write inside the SQL tab, whatever I try the OK button is still disabled and the statusbar says: Please enter function source code.</p>