Forum OpenACS Q&A: I cant create group types

Collapse
Posted by Juan Carlos on
Hi, I'm trying to create a new group type in my OpenACS, but I get this error.

Database operation "0or1row" failed (exception ERROR, "ERROR: relation "user_objects" does not exist
LINE 4: from user_objects
^
")

ERROR: relation "user_objects" does not exist
LINE 4: from user_objects
^

SQL:

select case when exists (select 1
from user_objects
where status = 'INVALID'
and object_name = upper('numeros')
and object_type = upper('package'))
then 0 else 1 end

What can I do?

Collapse
Posted by Benjamin Brink on

The error says that "user_objects" does not exist.

To access the database (in ubuntu-server installed using install-ns scripts) for checking queries manually and find out more about the tables:

~$ sudo su - postgres
~$ psql 5-9
psql (9.3.16)
Type "help" for help.

5-9=# \d user_objects
Did not find any relation named "user_objects".
5-9=# 
Collapse
Posted by Juan Carlos on
Yes, I know that table doestn exist, But why not?. It should exist with the installation, right?
Collapse
Posted by Benjamin Brink on

If you are following a guide, tutorial, or documentation example et cetera, please provide context. It looks like your reference is stale.

From the 5-9/package directory, I typed this to find any cases of it in the system:

bb@openacs-a22:/var/www/5-9/packages#  grep -R user_objects
acs-subsite/tcl/package-procs-oracle.xql:                                       from user_objects
acs-subsite/tcl/package-procs-postgresql.xql:--                                       from user_objects
acs-subsite/www/admin/group-types/delete-2-oracle.xql:                               from user_objects o
acs-api-browser/www/plsql-subprograms-all-oracle.xql:    from user_objects
acs-lang/sql/oracle/upgrade/upgrade-4.7d5-4.7d6.sql:	from user_objects
bb@openacs-a22:/var/www/5-9/packages#

user_objects is only used in comments.

The code in acs-subsite/tcl/package-procs-postgresql.xql suggests the query has been replaced with a simple case of select 1 from dual;.

Maybe look at these documents for alternatives:
https://openacs.org/doc/object-system-design#object-system-design-api and

https://openacs.org/doc/tutorial-database

Collapse
Posted by Benjamin Brink on
correction 'grep -R user_objects' should have been 'grep -R user_objects *'
Collapse
Posted by Brian Fenton on
Hi Juan

user_objects is an Oracle internal table, you probably shouldn't be referring to it if you're using Postgres.

Can you verify that your Naviserver config.tcl isn't using oracle anywhere (maybe for one of the pools for example)?
Brian

Collapse
Posted by Juan Carlos on
I Checked, and every time I see "oracle" is in a condition that checks if the database being used is oracle or postgres. So that means OpenACS should know I'm using postgres.
Collapse
Posted by Juan Carlos on
Nevermind, problem solved. I Upgraded OpenACS to 5.9.1b3