Postgresql – Postgres cursor lazy evaluation
I am trying to replicate a function from Oracle that has the following piece of code OPEN pcursor FOR v_sql; loop fetch pcursor into out_rec.XYZ ; exit when pcursor%NOTFOUND; INSERT INTO tab1 VALUES (out_rec.XYZ); COMMIT; pipe row(out_rec); end loop; EXCEPTION…