title: Converting function from Oracle to PostgreSQL
body: <p>I am working on converting something from Oracle to PostgreSQL. In the Oracle file there is a function:</p>
  
  <pre><code>instr(string,substring,starting point,nth location)
  </code></pre>
  
  <p>or as it is in my file</p>
  
  <pre><code>instr(string,chr(10),instr(string,substring),1)
  </code></pre>
  
  <p>In PostgreSQL this does not exist, so I looked up an equivalent function. I found:</p>
  
  <pre><code>position(substring in string)
  </code></pre>
  
  <p>but this does not allow the starting position and the nth location parameters. </p>
  
  <p>Is there anyway to make this function start at a given point? Or is there a better function to use in PostgreSQL where I can specify starting position and the nth location? </p>
  
  <p>This would have to work on PostgreSQL 8.2.15 because that is the version we are running on the database.</p>