Index: openacs-4/packages/categories/sql/postgresql/category-package.sql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/categories/sql/postgresql/category-package.sql,v
diff -u -N -r1.9 -r1.9.2.1
--- openacs-4/packages/categories/sql/postgresql/category-package.sql	7 Aug 2017 23:48:05 -0000	1.9
+++ openacs-4/packages/categories/sql/postgresql/category-package.sql	16 Apr 2019 13:52:12 -0000	1.9.2.1
@@ -314,7 +314,7 @@
 	and left_ind > v_old_left_ind;
 
 	if (p_parent_id is null) then
-	   select 1, max(right_ind)+1 into v_new_left_ind, v_new_right_ind
+	   select 1, coalesce(max(right_ind)+1, 1) into v_new_left_ind, v_new_right_ind
 	   from categories
 	   where tree_id = p_tree_id;
 	else
