Index: openacs-4/packages/acs-kernel/sql/postgresql/acs-object-util.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-kernel/sql/postgresql/acs-object-util.sql,v diff -u -r1.3 -r1.3.10.1 --- openacs-4/packages/acs-kernel/sql/postgresql/acs-object-util.sql 8 Dec 2001 01:17:59 -0000 1.3 +++ openacs-4/packages/acs-kernel/sql/postgresql/acs-object-util.sql 24 Nov 2003 17:25:15 -0000 1.3.10.1 @@ -1,6 +1,6 @@ -- moved from site-wide search to acs-kernel -create function acs_object_util__object_type_exist_p (varchar) +create or replace function acs_object_util__object_type_exist_p (varchar) returns boolean as ' declare p_object_type alias for $1; @@ -13,10 +13,10 @@ where object_type = p_object_type; return v_exist_p; -end;' language 'plpgsql'; +end;' language 'plpgsql' stable; -create function acs_object_util__get_object_type (integer) +create or replace function acs_object_util__get_object_type (integer) returns varchar as ' declare p_object_id alias for $1; @@ -26,16 +26,16 @@ from acs_objects where object_id = p_object_id; - return v_object_type; - if not found then - raise exception ''Invalid Object id: % '', p_object_id; + raise exception ''acs_object_util__get_object_type: Invalid Object id: % '', p_object_id; end if; -end;' language 'plpgsql'; + return v_object_type; +end;' language 'plpgsql' stable; -create function acs_object_util__type_ancestor_type_p (varchar,varchar) + +create or replace function acs_object_util__type_ancestor_type_p (varchar,varchar) returns boolean as ' declare p_object_type1 alias for $1; @@ -55,11 +55,11 @@ where p_object_type2 = o2.object_type and o1.object_type = p_object_type1 and o1.tree_sortkey between o2.tree_sortkey and tree_right(o2.tree_sortkey)); -end;' language 'plpgsql'; +end;' language 'plpgsql' stable; -create function acs_object_util__object_ancestor_type_p (integer,varchar) +create or replace function acs_object_util__object_ancestor_type_p (integer,varchar) returns boolean as ' declare p_object_id alias for $1; @@ -71,10 +71,10 @@ v_exist_p := acs_object_util__type_ancestor_type_p (v_object_type, p_object_type); return v_exist_p; -end;' language 'plpgsql'; +end;' language 'plpgsql' stable; -create function acs_object_util__object_type_p (integer,varchar) +create or replace function acs_object_util__object_type_p (integer,varchar) returns boolean as ' declare p_object_id alias for $1; @@ -83,4 +83,4 @@ begin v_exist_p := acs_object_util__object_ancestor_type_p(p_object_id, p_object_type); return v_exist_p; -end;' language 'plpgsql'; +end;' language 'plpgsql' stable;