0

all, I have logic in Oracle and should migrate to PostgreSQL. But the version of PostgreSQL doesn't support "with recursive" it's v.8.3. Can you help me?

BR

Oracle logic:

select t1.re_id from ib_re t1, ib_re_usage t2 Where t1.re_id = t2.re_id Start with t1.re_id in (1035,1036) Connect by parent_re_id = Prior t1.re_id

Septiana Fajrin
  • 123
  • 1
  • 3
  • 10
  • 2
    Postgres 8.3 is completely outdated and no longer supported. You shouldn't use that - especially not if you are migrating into a new environment. Every supported and maintained version of Postgres supports recursive common table expressions –  Dec 04 '19 at 06:37
  • Ya, sure, but the server use this version. Have u any answer for this query? – Septiana Fajrin Dec 04 '19 at 06:40
  • 3
    The only sane and sensible solution is to use a supported Postgres version. –  Dec 04 '19 at 07:01
  • There is no recursive query in 8.3, and nobody is willing to code PL/pgSQL for you so that you can continue to use a software that will eventually eat your data. It's in your own interest. – Laurenz Albe Dec 04 '19 at 07:20
  • The `tablefunc` extension provides a `connectby()` [function](https://www.postgresql.org/docs/8.3/tablefunc.html#AEN108200) - but you **really** should **not** use that outdated Postgres version. –  Dec 04 '19 at 07:55
  • It's possible or not if I use a subquery and union for this issue in PostgreSQL? – Septiana Fajrin Dec 04 '19 at 07:58

0 Answers0