Forum OpenACS Q&A: Re: ns_ora to ns_pg migration

Collapse
Posted by Andrew Piskorski on
OpenACS has included database-independent LOB functions for a long time. e.g, db_blob_get_file, db_write_blob, and db_write_clob, most of which call db_exec_lob underneath to do the Oracle or PostgreSQL specific stuff. You should port your old Oracle specific code to use those, not the PostgreSQL specific APIs.

There's also no particular reason that most of this underlying functionality should be unique to each AOLserver database driver. It would be better to standardize the APIs for LOBs, bind variables, etc., and add that extended functionality to the ns_db API. That's been talked about on the AOLserver list, but AFAIK no one has actually done it yet. But for your purposes that doesn't matter, just use the OpenACS functions.

Collapse
Posted by Andrew Piskorski on
Hm, I assumed above that you are upgrading your site from ACS 3.2 to OpenACS 5.x. That's what I'd probably recommend, even though it's likely to be a lot of work.

Are you in fact upgrading to OpenACS? Or are you staying on your (forked, presumably) ACS 3.2 codebase and converting it to use PostgreSQL? If the latter, well, that's basically what OpenACS 3.2 was, you should look at it. The more modern OpenACS 5.x db_* api is also still relevant, even if only as a source of examples.