-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Highest
-
Affects Version/s: 2.0 beta 1
-
Component/s: Database (Postgresql)
-
None
-
Environment:
Using tomcat as application server, sun JDK 1.5 on Linux with PostgreSQL as Database.
With postgresql, when I try to define which builder to use, only Script is available, even if others builders are defined.
Looking at the log I saw:
net.sf.hibernate.util.JDBCExceptionReporter logExceptions ATTENTION: SQL Error: 0, SQLState: 42883
net.sf.hibernate.util.JDBCExceptionReporter logExceptions GRAVE: ERROR: function locate(character varying, character varying) does not exist
I added the two following functions to my database (not sure the second is needed)
CREATE OR REPLACE FUNCTION locate("substring" "varchar", string "varchar")
RETURNS int4 AS
'select position(lower($1) in lower($2));'
LANGUAGE 'sql' VOLATILE;
CREATE OR REPLACE FUNCTION locate("substring" "varchar", string "varchar", "position" int4)
RETURNS int4 AS
$BODY$select CASE WHEN locate($1, substring($2, $3)) = 0
THEN 0
ELSE
$3 + locate($1, substring($2, $3)) - 1
END$BODY$
LANGUAGE 'sql' VOLATILE;
and after that bamboo seems to be working just fine.