title: (Postgres) row_number OVER Partition in 8.2
body: <p>some time ago I happend to resolve a PG related problem with <a href="https://stackoverflow.com/questions/1400056/postgress-actual-record-number-in-recordset">this SO question of mine</a>.
  Basically it's about using row_number over a partition in 8.4.</p>
  
  <p>Sadly now I have to create the same thing for 8.2 since one of my customers is on
  8.2 and needs it desperatly.</p>
  
  <p>What I do know (on 8.4) is the following:</p>
  
  <pre><code>SELECT custId, custName, 'xyz-' || row_number() OVER (PARTITION by custId) 
  AS custCode
  </code></pre>
  
  <p>Basically counting the occurances of custId and assigning custCodes from that.
  (just an example, to show what I to; of course the query is way more complex)</p>
  
  <p>I figured the solutions provided to the question mentioned above, but did'nt get them
  working since there's one more hurdle to take. I don't run SQL directly I have to
  embed it into a xml based config file which creates a certain xml format from the query 
  results. So creating temp stuff or procedures is not really an option.</p>
  
  <p>So here's the question, does anyone of you guys have an idea how to port that solution of
  mine to PG 8.2?</p>
  
  <p>TIA</p>
  
  <p>K</p>