Fork me on GitHub

Frequently Asked Questions

  1. When do I have to set the delimiterType?
When do I have to set the delimiterType?

By default the sql-maven-plugin will check if a line contains the specified delimiter, which is by default a semicolon(;). More complex statements, such as a trigger creation, may contain semi-colons too, although these are not yet the end of the sql-statement. In such case you have to change the delimiterType to 'row'.

Now the plugin will check if the complete row matches the delimiter, in order to recognize the end of the sql statement.

An example when to use <delimiterType>row</delimiterType>:

 CREATE OR REPLACE FUNCTION my_trig()
 RETURNS "trigger" AS
 $BODY$
   declare 
   t text; 
   begin
    -- any plpgsql code here, where each line ends with a semicolon
   return NEW; 
 end$BODY$
 LANGUAGE 'plpgsql' VOLATILE;   
Note: Delimiters within values or comments are not a problem, these will be ignored.

Note: The sql will be parsed until the delimiter or the EOF.

[top]