1

I need to port an application that uses Oracle mod_plsql to PostgreSQL. Currently database procedures are called over HTTP with the use of Apache + mod_plsql. The procedures are easily ported to PostgreSQL, but I can not find a replacement for the Apache + mod_plsql part. Does anybody have any experience on ho to do it and what to use?

UPDATE (to make stuff more clear):

See: http://docs.oracle.com/cd/B14099_19/web.1012/b14010/concept.htm for how mod_plsql work.

What I need is a way to call a function on postgrsql as:

protocol://hostname[:port]/DAD_location/[[!][schema.][package.]proc_name[?query_string]]

ei:

http://www.acme.com:9000/pls/mydad/mypackage.myproc?a=v&b=1

sposnjak
  • 1,491
  • 2
  • 15
  • 25
  • Er, what? So the PL/SQL procedures generate HTML directly? I suspect you're going to need a thin wrapper in a scripting language to meet your needs - I'd use (say) a Python script that used `path_info` / query params to determine which procedure to run and what params to send it and streamed the result back to the client. Replace "python script" with your preferred tool. – Craig Ringer Mar 06 '14 at 12:42
  • A thin wrapper is not an option. (see my question with edit) – sposnjak Mar 06 '14 at 13:08
  • I suspect you'll have to write a `mod_plpgsql` or port `mod_plsql` then. Though I don't see why a wrapper is a problem, it's effectively the same thing. – Craig Ringer Mar 06 '14 at 13:47
  • You'll have to rewrite the code. That's the price you are paying if you code the application in the database. The up side is that you don't have to worry about migrating the application server. – Laurenz Albe Sep 23 '18 at 11:59

1 Answers1

0

You could fork my NodeJS based implementation of web_plsql as a starting point and "simply" replace the Oracle access with PostgreSQL.

You should be able to use pretty much all of the logic in NodeJS and only need to change the way how the code interacts with the database in the oracle.js module.

doberkofler
  • 9,511
  • 18
  • 74
  • 126