make cubicweb-ctl db-init -d work with postgresql backend stable
authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
Wed, 16 Dec 2009 10:06:00 +0100
branchstable
changeset 4126 2eb47c1efee1
parent 4120 21517d42f2ed
child 4127 3b442047db3f
make cubicweb-ctl db-init -d work with postgresql backend
schemas/_regproc.postgres.sql
--- a/schemas/_regproc.postgres.sql	Tue Dec 15 11:30:44 2009 +0100
+++ b/schemas/_regproc.postgres.sql	Wed Dec 16 10:06:00 2009 +0100
@@ -5,10 +5,12 @@
 
 */
 
+DROP FUNCTION IF EXISTS comma_join (anyarray) CASCADE;
 CREATE FUNCTION comma_join (anyarray) RETURNS text AS $$
     SELECT array_to_string($1, ', ')
 $$ LANGUAGE SQL;;
 
+DROP AGGREGATE IF EXISTS group_concat (anyelement) CASCADE;
 CREATE AGGREGATE group_concat (
   basetype = anyelement,
   sfunc = array_append,
@@ -19,6 +21,7 @@
 
 
 
+DROP FUNCTION IF EXISTS limit_size (fulltext text, format text, maxsize integer);
 CREATE FUNCTION limit_size (fulltext text, format text, maxsize integer) RETURNS text AS $$
 DECLARE
     plaintext text;
@@ -39,7 +42,7 @@
 END
 $$ LANGUAGE plpgsql;;
 
-
+DROP FUNCTION IF EXISTS text_limit_size (fulltext text, maxsize integer);
 CREATE FUNCTION text_limit_size (fulltext text, maxsize integer) RETURNS text AS $$
 BEGIN
     RETURN limit_size(fulltext, 'text/plain', maxsize);