title: How to migrate from oracle to postgre using "WITH RECURSIVE" and "REGEXP_SUBSTR"?
body: <p>There is code on oracle, how to port it to postgre without increasing it much?</p>
  <pre><code>                       SELECT pl.rd,
            pl.rs,
            pl.agency_plan,
            pl.o__id
       FROM ALIS.PLAF pl
       WHERE RD BETWEEN to_date('01.'||pMM||'.'||pYYYY, 'dd.mm.yyyy') AND last_day(to_date('01.'||pMM||'.'||pYYYY, 'dd.mm.yyyy'))
         AND RS IN (SELECT TO_CHAR(REGEXP_SUBSTR(str, '[^,]+', 1, LEVEL)) RS
             FROM (SELECT TO_CHAR(P_RS_LIST) str
                 FROM dual) t CONNECT BY INSTR(str, ',', 1, LEVEL - 1) &gt; 0);
                 
  </code></pre>