title: Postgres function: assiging results from built-in function to variable
body: <p>How to assign results of REPLACE() built-in Postgres function to another variable?
  I am trying something like this, but it does not work:</p>
  <pre><code>CREATE FUNCTION uri2text(uri text) RETURNS text AS $$
  SET temp_text = SELECT REPLACE(uri , '%20', ' ');
  RETURN temp_text;
  $$ LANGUAGE SQL;
  </code></pre>