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.11.10.1 -r1.11.10.2 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-relationships-create.sql 24 Nov 2003 17:25:15 -0000 1.11.10.1 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-relationships-create.sql 13 Dec 2003 00:48:30 -0000 1.11.10.2 @@ -267,19 +267,22 @@ declare drop_type__rel_type alias for $1; drop_type__cascade_p alias for $2; -- default ''f'' + v_cascade boolean; begin -- XXX do cascade_p. -- JCD: cascade_p seems to be ignored in acs_o_type__drop_type anyway... if drop_type__cascade_p is null then - drop_type__cascade_p := ''f''; + v_cascade_p := ''f''; + else + v_cascade_p := drop_type__cascade_p; end if; delete from acs_rel_types where rel_type = drop_type__rel_type; PERFORM acs_object_type__drop_type(drop_type__rel_type, - drop_type__cascade_p); + v_cascade_p); return 0; end;' language 'plpgsql'; Index: openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql,v diff -u -r1.46.2.1 -r1.46.2.2 --- openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql 24 Nov 2003 17:25:15 -0000 1.46.2.1 +++ openacs-4/packages/acs-kernel/sql/postgresql/apm-create.sql 13 Dec 2003 00:48:30 -0000 1.46.2.2 @@ -1746,13 +1746,14 @@ declare highest_version__package_key alias for $1; v_version_id apm_package_versions.version_id%TYPE; + v_max_version varchar; begin - select version_id into v_version_id - from apm_package_version_info i - where apm_package_version__sortable_version_name(version_name) = - (select max(apm_package_version__sortable_version_name(v.version_name)) - from apm_package_version_info v where v.package_key = highest_version__package_key) - and package_key = highest_version__package_key; + select max(apm_package_version__sortable_version_name(v.version_name)) into v_max_version + from apm_package_version_info v where v.package_key = highest_version__package_key; + + select version_id into v_version_id from apm_package_version_info i + where apm_package_version__sortable_version_name(version_name) = v_max_version and i.package_key = highest_version__package_key; + if NOT FOUND then return 0; else Index: openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql,v diff -u -r1.1.2.2 -r1.1.2.3 --- openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql 30 Nov 2003 01:17:56 -0000 1.1.2.2 +++ openacs-4/packages/acs-kernel/sql/postgresql/upgrade/upgrade-5.0.0b3-5.0.0b4.sql 13 Dec 2003 00:48:30 -0000 1.1.2.3 @@ -531,25 +531,26 @@ declare drop_type__rel_type alias for $1; drop_type__cascade_p alias for $2; -- default ''f'' + v_cascade boolean; begin -- XXX do cascade_p. -- JCD: cascade_p seems to be ignored in acs_o_type__drop_type anyway... - if drop_type__cascade_p is null then - drop_type__cascade_p := ''f''; + v_cascade_p := ''f''; + else + v_cascade_p := drop_type__cascade_p; end if; delete from acs_rel_types where rel_type = drop_type__rel_type; PERFORM acs_object_type__drop_type(drop_type__rel_type, - drop_type__cascade_p); + v_cascade_p); return 0; end;' language 'plpgsql'; - create or replace function apm__unregister_package (varchar,boolean) returns integer as ' declare