title: Javascript encodeURI like function in postgresql?
body: <p>Is there any function/stored procedure in PostgreSQL/plpgsql which is same as the javascripts encodeURI?</p>
  
  <p>What does it mean? Javascript have a handy built in function to encode any kind of url:</p>
  
  <p>encodeURI(url) -> returns the encoded url</p>
  
  <p>For example: 
  <code>encodeURI('http://hu.wikipedia.org/wiki/São_Paulo')</code> -> returns a String which is <code>"http://hu.wikipedia.org/wiki/S%C3%A3o_Paulo"</code></p>
  
  <p>I looking for exactly the same. </p>
  
  <p>I don't want to encode each parameters separately. I don't want a function like javascript encodeURIComponent which is not the same. The example above results a different output with </p>
  
  <pre><code>encodeURIComponent('http://hu.wikipedia.org/wiki/São_Paulo')
  </code></pre>
  
  <p>-> <code>"http%3A%2F%2Fhu.wikipedia.org%2Fwiki%2FS%C3%A3o_Paulo"</code></p>
  
  <p>It's encode the whole string not just the path part. So this is not what I'm looking for. I need a plpgsql function which results equivalent output to javascript function encodeURI.</p>
  
  <p>Thanks!</p>