Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-metadata-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-metadata-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-metadata-create.sql 14 Mar 2001 04:39:10 -0000 1.1 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-metadata-create.sql 14 Mar 2001 14:07:31 -0000 1.2 @@ -226,9 +226,9 @@ where ota.object_type in (select ot2.object_type from acs_object_types ot1, acs_object_types ot2 - where o1.object_type = ot.supertype - and o2.tree_sortkey <= o1.tree_sortkey - and o1.tree_sortkey like (o2.tree_sortkey || '%')); + where ot1.object_type = ot.supertype + and ot2.tree_sortkey <= ot1.tree_sortkey + and ot1.tree_sortkey like (ot2.tree_sortkey || '%')); create table acs_object_type_tables ( @@ -693,7 +693,7 @@ where exists (select 1 from acs_object_types t where t.object_type = is_subtype_p__object_type_2 - and tree_sortkey like (select tree_sortkey || '%' + and tree_sortkey like (select tree_sortkey || ''%'' from acs_object_types where object_type = is_subtype_p__object_type_1 )); Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql 14 Mar 2001 04:39:10 -0000 1.1 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-objects-create.sql 14 Mar 2001 14:07:31 -0000 1.2 @@ -602,7 +602,7 @@ from acs_objects o where o.object_id = delete__object_id) and o2.tree_sortkey <= o1.tree_sortkey - and o1.tree_sortkey like (o2.tree_sortkey || '%') + and o1.tree_sortkey like (o2.tree_sortkey || ''%'') order by tree_sortkey desc) loop -- Delete from the table. @@ -643,7 +643,7 @@ from acs_objects o where o.object_id = name__object_id) and o2.tree_sortkey <= o1.tree_sortkey - and o1.tree_sortkey like (o2.tree_sortkey || '%') + and o1.tree_sortkey like (o2.tree_sortkey || ''%'') order by tree_sortkey desc) loop if obj_type.name_method is not null then @@ -730,7 +730,7 @@ from acs_objects o where o.object_id = object_id_in) and o2.tree_sortkey <= o1.tree_sortkey - and o1.tree_sortkey like (o2.tree_sortkey || '%') + and o1.tree_sortkey like (o2.tree_sortkey || ''%'') ) t where a.attribute_name = attribute_name_in Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-relationships-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-relationships-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-relationships-create.sql 14 Mar 2001 04:39:10 -0000 1.1 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-relationships-create.sql 14 Mar 2001 14:07:31 -0000 1.2 @@ -440,14 +440,14 @@ from acs_object_types t where t.object_type = o1.object_type and t.tree_sortkey - like (select o.tree_sortkey || '%' + like (select o.tree_sortkey || ''%'' from acs_object_types o where o.object_type = rt.object_type_one)) and exists (select 1 from acs_object_types t where t.object_type = o2.object_type and t.tree_sortkey - like (select o.tree_sortkey || '%' + like (select o.tree_sortkey || ''%'' from acs_object_types o where o.object_type = rt.object_type_two)) and rt.rel_type = new.rel_type Index: openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql 14 Mar 2001 05:56:26 -0000 1.2 +++ openacs-4/packages/acs-kernel/sql/postgresql/rel-constraints-create.sql 14 Mar 2001 14:07:31 -0000 1.3 @@ -678,12 +678,12 @@ -- DCW 2001-03-14. create view rc_segment_dependency_levels as - select rel_segment as segment_id, - max(tree_level) as dependency_level + select rc.rel_segment as segment_id, + max(rc.tree_level) as dependency_level from (select rc1.rel_segment, tree_level(rc1.tree_sortkey) as tree_level from rel_constraints rc1, rel_constraints rc2 where rc1.tree_sortkey like rc2.tree_sortkey || '%' - and rc2.rel_side = 'two') + and rc2.rel_side = 'two') rc group by segment_id; -------------- Index: openacs-4/packages/acs-kernel/sql/postgresql/rel-segments-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/rel-segments-create.sql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-kernel/sql/postgresql/rel-segments-create.sql 14 Mar 2001 04:39:10 -0000 1.1 +++ openacs-4/packages/acs-kernel/sql/postgresql/rel-segments-create.sql 14 Mar 2001 14:07:31 -0000 1.2 @@ -194,7 +194,7 @@ from rel_segments rs, group_element_map gem where gem.group_id = rs.group_id - and rs.rel_type in (select object_type + and rs.rel_type in (select o2.object_type from acs_object_types o1, acs_object_types o2 where o1.object_type = gem.rel_type and o2.tree_sortkey <= o1.tree_sortkey @@ -230,7 +230,7 @@ gem.rel_type, gem.group_id, gem.container_id from membership_rels mr, group_element_map gem, rel_segments rs where rs.group_id = gem.group_id - and rs.rel_type in (select object_type + and rs.rel_type in (select o2.object_type from acs_object_types o1, acs_object_types o2 where o1.object_type = gem.rel_type and o2.tree_sortkey <= o1.tree_sortkey @@ -319,7 +319,7 @@ from groups) gcm, acs_rel_types where s.group_id = gcm.group_id - and s.rel_type in (select object_type + and s.rel_type in (select o2.object_type from acs_object_types o1, acs_object_types o2 where o1.object_type = acs_rel_types.rel_type and o2.tree_sortkey <= o1.tree_sortkey