Forum OpenACS Development: acs_privilege__drop_privilege on pg?

Hi!
I'm having problems deleting a package, looking at what is happening I found that when is created something like:

select acs_privilege__create_privilege(
                'wp_roc',
                null,
                null
        );

select acs_privilege__create_privilege(
                'wp_joshi',
                null,
                null
        );

then do a child relation:
select acs_privilege__add_child('wp_roc','wp_joshi');

and when I try to remove everything in this way:
select acs_privilege__remove_child('wp_roc','wp_joshi');

I got an error here:
select acs_privilege__drop_privilege('wp_joshi');
ERROR:  acs_priv_hier_child_priv_fk referential integrity violation - key in acs_privileges still referenced from acs_privilege_descendant_map

Thanks for the help!

p.d. I did the same in oracle without problems!

Collapse
Posted by Rocael Hernández Rizzardini on
when is called acs_privilege__create_privilege nothing is inserted on acs_privilege_descendant_map,
but when is called acs_privilege__add_child ('one_priv', 'second_priv'), even if a permission is not involved in this call, I got in acs_privilege_descendant_map a row like this:
        privilege        |      descendant
-------------------------+-------------------------
new_priv                | new_priv

and then triying this:
select acs_privilege__drop_privilege('new_priv');
ERROR:  acs_priv_hier_child_priv_fk referential integrity violation - key in acs_privileges still referenced from acs_privilege_descendant_map

might be a delete cascade or a trigger that is missing, in oracle acs_privilege_descendant_map is a view so there is no problem in that way, but in pg is a table.