Index: openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.0.3d1-2.0.3d2.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.0.3d1-2.0.3d2.sql,v diff -u -r1.2 -r1.2.12.1 --- openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.0.3d1-2.0.3d2.sql 29 Jun 2004 10:18:47 -0000 1.2 +++ openacs-4/packages/static-portlet/sql/postgresql/upgrade/upgrade-2.0.3d1-2.0.3d2.sql 19 Aug 2014 17:11:31 -0000 1.2.12.1 @@ -2,31 +2,30 @@ update static_portal_content set body = content; alter table static_portal_content drop column content; -create or replace function static_portal_content_item__new ( - integer, -- package_id in static_portal_content.package_id%TYPE default null, - varchar, -- pretty_name in static_portal_content.pretty_name%TYPE default null, - varchar, -- content in static_portal_content.content%TYPE default null, - varchar, -- object_type in acs_objects.object_type%TYPE default [static_portal_content], - timestamptz, -- creation_date in acs_objects.creation_date%TYPE default sysdate, - integer, -- creation_user in acs_objects.creation_user%TYPE default null, - varchar, -- creation_ip in acs_objects.creation_ip%TYPE default null, - integer -- context_id in acs_objects.context_id%TYPE default null -) -returns integer as ' -declare - p_package_id alias for $1; - p_pretty_name alias for $2; - p_content alias for $3; - p_object_type alias for $4; - p_creation_date alias for $5; - p_creation_user alias for $6; - p_creation_ip alias for $7; - p_context_id alias for $8; + + +-- added +select define_function_args('static_portal_content_item__new','package_id,pretty_name,content,object_type,creation_date,creation_user,creation_ip,context_id'); + +-- +-- procedure static_portal_content_item__new/8 +-- +CREATE OR REPLACE FUNCTION static_portal_content_item__new( + p_package_id integer, + p_pretty_name varchar, + p_content varchar, + p_object_type varchar, + p_creation_date timestamptz, + p_creation_user integer, + p_creation_ip varchar, + p_context_id integer +) RETURNS integer AS $$ +DECLARE v_content_id static_portal_content.content_id%TYPE; v_object_type varchar; -begin +BEGIN if p_object_type is null then - v_object_type := ''static_portal_content''; + v_object_type := 'static_portal_content'; else v_object_type := p_object_type; end if; @@ -47,4 +46,5 @@ (v_content_id, p_package_id, p_pretty_name, p_content); return v_content_id; -end;' language 'plpgsql'; +END; +$$ LANGUAGE plpgsql;