Index: openacs-4/packages/chat-portlet/sql/postgresql/chat-portlet-drop.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/chat-portlet/sql/postgresql/chat-portlet-drop.sql,v
diff -u -r1.1 -r1.2
--- openacs-4/packages/chat-portlet/sql/postgresql/chat-portlet-drop.sql	14 Mar 2006 12:23:37 -0000	1.1
+++ openacs-4/packages/chat-portlet/sql/postgresql/chat-portlet-drop.sql	7 Aug 2017 23:48:07 -0000	1.2
@@ -20,18 +20,24 @@
 --   @creation-date 2004-10-10
 --   @version $Id: chat-portlet-drop.sql,v 0.1 2004/10/10
 
-create function inline_1()
-returns integer as '
-declare  
+
+
+--
+-- procedure inline_1/0
+--
+CREATE OR REPLACE FUNCTION inline_1(
+
+) RETURNS integer AS $$
+DECLARE  
   ds_id portal_datasources.datasource_id%TYPE;
-begin
+BEGIN
 
   select datasource_id into ds_id
       from portal_datasources
-     where name = ''chat_portlet'';
+     where name = 'chat_portlet';
 
    if not found then
-     RAISE EXCEPTION '' No datasource id found '', ds_id;
+     RAISE EXCEPTION ' No datasource id found ', ds_id;
      ds_id := null;
    end if;
 
@@ -41,62 +47,63 @@
 
         -- drop the hooks
         perform acs_sc_impl_alias__delete (
-               ''portal_datasource'',
-               ''chat_portlet'',
-               ''GetMyName''
+               'portal_datasource',
+               'chat_portlet',
+               'GetMyName'
         );
 
         perform acs_sc_impl_alias__delete (
-               ''portal_datasource'',
-               ''chat_portlet'',
-               ''GetPrettyName''
+               'portal_datasource',
+               'chat_portlet',
+               'GetPrettyName'
         );
 
 
         perform acs_sc_impl_alias__delete (
-               ''portal_datasource'',
-               ''chat_portlet'',
-               ''Link''
+               'portal_datasource',
+               'chat_portlet',
+               'Link'
         );
 
         perform acs_sc_impl_alias__delete (
-               ''portal_datasource'',
-               ''chat_portlet'',
-               ''AddSelfToPage''
+               'portal_datasource',
+               'chat_portlet',
+               'AddSelfToPage'
         );
 
         perform acs_sc_impl_alias__delete (
-               ''portal_datasource'',
-               ''chat_portlet'',
-               ''Show''
+               'portal_datasource',
+               'chat_portlet',
+               'Show'
         );
 
         perform acs_sc_impl_alias__delete (
-               ''portal_datasource'',
-               ''chat_portlet'',
-               ''Edit''
+               'portal_datasource',
+               'chat_portlet',
+               'Edit'
         );
 
         perform acs_sc_impl_alias__delete (
-               ''portal_datasource'',
-               ''chat_portlet'',
-               ''RemoveSelfFromPage''
+               'portal_datasource',
+               'chat_portlet',
+               'RemoveSelfFromPage'
         );
 
         -- Drop the binding
         perform acs_sc_binding__delete (
-            ''portal_datasource'',
-            ''chat_portlet''
+            'portal_datasource',
+            'chat_portlet'
         );
 
         -- drop the impl
         perform acs_sc_impl__delete (
-                ''portal_datasource'',
-                ''chat_portlet''
+                'portal_datasource',
+                'chat_portlet'
         );
         
         return 0;
-end;' language 'plpgsql';
+END;
+$$ LANGUAGE plpgsql;
 
 select inline_1();
 drop function inline_1();
