Index: openacs-4/packages/calendar/sql/postgresql/calendar-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/calendar/sql/postgresql/calendar-drop.sql,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/calendar/sql/postgresql/calendar-drop.sql	10 Jan 2004 18:57:24 -0000	1.7
+++ openacs-4/packages/calendar/sql/postgresql/calendar-drop.sql	4 Sep 2017 08:10:38 -0000	1.8
@@ -113,24 +113,23 @@
 ------------------------------------------------
 
 DROP TABLE calendars;
-CREATE FUNCTION inline_0 ()
-RETURNS integer
-AS 'begin
-	PERFORM acs_attribute__drop_attribute (''calendar'',''owner_id'');
-	PERFORM acs_attribute__drop_attribute (''calendar'',''private_p'');
-	DELETE FROM acs_objects WHERE object_type = ''calendar'';
-	PERFORM acs_object_type__drop_type (''calendar'', ''f'');
 
+CREATE OR REPLACE FUNCTION inline_0 () RETURNS integer AS $$
+BEGIN
+	PERFORM acs_attribute__drop_attribute ('calendar','owner_id');
+	PERFORM acs_attribute__drop_attribute ('calendar','private_p');
+	DELETE FROM acs_objects WHERE object_type = 'calendar';
+	PERFORM acs_object_type__drop_type ('calendar', 'f');
+
 	return 0;
-    end;'
-LANGUAGE 'plpgsql';
+END;
+$$ LANGUAGE plpgsql;
 
 SELECT inline_0 ();
-
 DROP FUNCTION inline_0 ();
 
 
-DELETE FROM acs_objects WHERE object_type='calendar';
+DELETE FROM acs_objects WHERE object_type = 'calendar';
 
 DROP FUNCTION calendar__new (
        integer,            -- calendar.calendar_id%TYPE
