﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
22401	SQL Function initial SQL data does not work.	Julien GODIN	nobody	"I created a model and trying to add some functions to it : 
Full trace : 

{{{

Failed to install custom SQL for frontend.Alarm model: unterminated dollar-quoted string at or near ""$$ BEGIN RETURN + 1;""
LINE 1: ... FUNCTION increment(i integer) RETURNS integer AS $$ BEGIN R...

}}}

Here is the function I am trying to create : 
( stolen from here : http://www.postgresql.org/docs/9.1/static/sql-createfunction.html )

{{{
CREATE OR REPLACE FUNCTION increment(i integer) RETURNS integer AS $$
       BEGIN
                RETURN i + 1;
       END;
$$ LANGUAGE plpgsql;
}}}

The problem is in the _split_statements(content) function where it checks if the lines ends with "";"" and close the statement if so.
The problem is that PLSQL functions needs "";"" to work.


"	Bug	closed	Core (Management commands)	dev	Normal	duplicate			Accepted	0	0	0	0	0	0
