Forum OpenACS Development: OpenACS 5.9.0 , Postgresql 9.4, and Naviserver 4.99
"Database operation "0or1row" failed (exception NSINT, "Query returned more than one row.")
when running the query -
select 1 from pg_class where relname = 'apm_package_versions'
in the file packages/acs-tcl/tcl/site-nodes-procs.tcl .
The pg_class is in the catalog schema and has the information for all object relations. It will return an error if more than one OpenACS is installed on the same Postgresql DB Instance.
Here are the list of files that we modified to include filters for the "current_user":
Is this the appropriate fix?
if you want to set up multiple OpenACS instances (say the OpenACS instances "oacs-5-9" and "oacs-5-9-custom") against the same PostgreSQL installation (pg speak: "database cluster" ) , you have define create different databases  in this cluster for every OpenACS instance (the databases might be named e.g. oacs-5-9 and oacs-5-9-custom as well). The name of the db is specified in the startup file of the server.
if you try to run multiple OpenACS instances against the same database (using for both instances the same database instance name), many things will break fundamentally, the changes you indicate above are just the tip of the iceberg.
Thanks for the reply. This is a change from the previous way done with Postgresql 8.x where we created one db and have different users and schemas. Our system administrator went to an Enterprise DB training and it was recommended to go with the one DB approach. Out of curiosity, do you know why OpenACS went into multiple DBs direction ? Thanks.
Separate dbs makes it easier to migrate/upgrade/save one instance, the security separation is easier, etc. but altogether the pros/cons are somewhat even (see e.g. )