Index: openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-sample.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-sample.sql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-sample.sql	6 Feb 2006 13:06:29 -0000	1.4
+++ openacs-4/packages/acs-templating/sql/postgresql/template-demo-notes-sample.sql	30 Mar 2013 19:09:21 -0000	1.5
@@ -1,30 +1,32 @@
-create function template__make_sample_data() returns integer
-as
-'
-declare
+
+
+CREATE function template__make_sample_data(
+) 
+RETURNS integer AS $$
+DECLARE
     security_context_root int4;
     default_context int4;
     registered_users int4;
     unregistered_visitor int4;
     owning_party int4;
     context int4;
-begin
-    security_context_root := acs__magic_object_id(''security_context_root'');
-    default_context       := acs__magic_object_id(''default_context'');
-    registered_users      := acs__magic_object_id(''registered_users'');
-    unregistered_visitor  := acs__magic_object_id(''unregistered_visitor'');
+BEGIN
+    security_context_root := acs__magic_object_id('security_context_root');
+    default_context       := acs__magic_object_id('default_context');
+    registered_users      := acs__magic_object_id('registered_users');
+    unregistered_visitor  := acs__magic_object_id('unregistered_visitor');
 
     context := default_context;
     owning_party := unregistered_visitor;
 
     perform template_demo_note__new
 	(
 		NULL,
-		''title01'',
-		''body01'',
-		''red'',
+		'title01',
+		'body01',
+		'red',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -34,11 +36,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title02'',
-		''body02'',
-		''blue'',
+		'title02',
+		'body02',
+		'blue',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -48,11 +50,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title03'',
-		''body03'',
-		''green'',
+		'title03',
+		'body03',
+		'green',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -62,11 +64,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title04'',
-		''body04'',
-		''orange'',
+		'title04',
+		'body04',
+		'orange',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -76,11 +78,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title05'',
-		''body05'',
-		''purple'',
+		'title05',
+		'body05',
+		'purple',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -90,11 +92,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title06'',
-		''body06'',
-		''red'',
+		'title06',
+		'body06',
+		'red',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -104,11 +106,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title07'',
-		''body07'',
-		''blue'',
+		'title07',
+		'body07',
+		'blue',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -118,11 +120,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title08'',
-		''body08'',
-		''green'',
+		'title08',
+		'body08',
+		'green',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -132,11 +134,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title09'',
-		''body09'',
-		''orange'',
+		'title09',
+		'body09',
+		'orange',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -146,11 +148,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title10'',
-		''body10'',
-		''purple'',
+		'title10',
+		'body10',
+		'purple',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -160,11 +162,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title11'',
-		''body11'',
-		''red'',
+		'title11',
+		'body11',
+		'red',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -174,11 +176,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title12'',
-		''body12'',
-		''blue'',
+		'title12',
+		'body12',
+		'blue',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -188,11 +190,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title13'',
-		''body13'',
-		''green'',
+		'title13',
+		'body13',
+		'green',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -202,11 +204,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title14'',
-		''body14'',
-		''orange'',
+		'title14',
+		'body14',
+		'orange',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -216,11 +218,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title15'',
-		''body15'',
-		''purple'',
+		'title15',
+		'body15',
+		'purple',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -230,11 +232,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title16'',
-		''body16'',
-		''red'',
+		'title16',
+		'body16',
+		'red',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -244,11 +246,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title17'',
-		''body17'',
-		''blue'',
+		'title17',
+		'body17',
+		'blue',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -258,11 +260,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title18'',
-		''body18'',
-		''green'',
+		'title18',
+		'body18',
+		'green',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -272,11 +274,11 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title19'',
-		''body19'',
-		''orange'',
+		'title19',
+		'body19',
+		'orange',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
@@ -286,22 +288,22 @@
     perform template_demo_note__new
 	(
 		NULL,
-		''title20'',
-		''body20'',
-		''purple'',
+		'title20',
+		'body20',
+		'purple',
 
-		''template_demo_note'',
+		'template_demo_note',
 		now(),
 		owning_party,
 		NULL,
 		context
 	);
 
     return context;
-end;
-'
-language 'plpgsql';
+END;
 
+$$ LANGUAGE plpgsql;
+
 select template__make_sample_data();
 
 drop function template__make_sample_data();
