Forum OpenACS Development: Is it okay to define a skinny acs_object_type without table?

Request notifications

I don't see any cases in the db with a supertype of acs_object other than my test case:

# select object_type,supertype,package_name from acs_object_types where table_name is null;
      object_type       |    supertype     |      package_name      
------------------------+------------------+------------------------
 acs_message_revision   | content_revision | acs_message_revision
 meta_category_rel      | relationship     | meta_category_rel
 user_meta_category_rel | relationship     | user_meta_category_rel
 qal_blank_test1        | acs_object       | accounts-ledger
(4 rows)

Is this uncharted territory? or

Is it okay to define a skinny acs_object_type without table?

I want others to avoid pain from me using openacs objects in a nonstandard way in the packages I'm developing.

Apparently, not a good idea as there is still a unique constraint for the null case:

postgresql$ psql oacs-dev < entities-channels-drop.sql
 acs_object_type__drop_type 
----------------------------
                          0
(1 row)

 acs_object_type__drop_type 
----------------------------
                          0
(1 row)

 acs_object_type__drop_type 
----------------------------
                          0
(1 row)

DROP INDEX
DROP INDEX
...

postgresql$ psql oacs-dev < entities-channels-create.sql
 acs_object_type__create_type 
------------------------------
                            0
(1 row)

ERROR:  duplicate key value violates unique constraint "acs_object_types_table_name_un"
DETAIL:  Key (table_name)=() already exists.
CONTEXT:  SQL statement "insert into acs_object_types
      (object_type, pretty_name, pretty_plural, supertype, table_name,
       id_column, abstract_p, type_extension_table, package_name,
       name_method, dynamic_p)
    values
      (p_object_type, p_pretty_name, 
       p_pretty_plural, v_supertype, 
       v_table_name, v_id_column, 
       p_abstract_p, p_type_extension_table, 
       v_package_name, v_name_method, p_dynamic_p)"
PL/pgSQL function acs_object_type__create_type(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,character varying,boolean,boolean) line 54 at SQL statement
PL/pgSQL function acs_object_type__create_type(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,character varying) line 7 at RETURN
ERROR:  duplicate key value violates unique constraint "acs_object_types_table_name_un"
DETAIL:  Key (table_name)=() already exists.
CONTEXT:  SQL statement "insert into acs_object_types
      (object_type, pretty_name, pretty_plural, supertype, table_name,
       id_column, abstract_p, type_extension_table, package_name,
       name_method, dynamic_p)
    values
      (p_object_type, p_pretty_name, 
       p_pretty_plural, v_supertype, 
       v_table_name, v_id_column, 
       p_abstract_p, p_type_extension_table, 
       v_package_name, v_name_method, p_dynamic_p)"
PL/pgSQL function acs_object_type__create_type(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,character varying,boolean,boolean) line 54 at SQL statement
PL/pgSQL function acs_object_type__create_type(character varying,character varying,character varying,character varying,character varying,character varying,character varying,boolean,character varying,character varying) line 7 at RETURN
CREATE TABLE
CREATE INDEX