If PL/SQL is being called for the Oracle version, you need to use db_exec_plsql in both versions. The PG db api does some magic to make this work for multiple statements - very inefficiently, though. We'll
worry about that later. It's fine for single-statement selects such as required for single PL/pgSQL function calls.
I just looked at the infamous line 290 - that shouldn't be a db_dml call. db_dml in Oracle and PG should be reserved for real DML statements. db_exec_plsql will work for the Oracle code, won't it? It will for PG...