txm / dbdeploy

Automatically exported from code.google.com/p/dbdeploy
0 stars 0 forks source link

No easy way to handle multi-line strings #68

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
This will run OK:

CREATE FUNCTION my_function() RETURNS something
    AS 'BEGIN SELECT x INTO y FROM my_table; RETURN y; END;';

This will not:

CREATE FUNCTION my_function() RETURNS something AS '
BEGIN
    SELECT x INTO y FROM my_table;
    RETURN y;
END;';

I've tried a variety of multi-line string formattings, including blackslash 
'\', double-backslash '\\', changing the delimiter (eg. '$$' or '//') but 
nothing seems to work. What is recommended?

Using:
Apache Maven 3.0.3
com.dbdeploy:maven-dbdeploy-plugin:3.0M3
Windows 7 + CentOS 64bit
PostgreSQL 9.1rc1

Original issue reported on code.google.com by stewart....@gmail.com on 20 Mar 2012 at 10:21

GoogleCodeExporter commented 9 years ago
Ok, so I'm having a Homer Simpson day ...

I've solved this by use of the 'delimitertype' argument and judicious location 
of the ';' delimiter in each SQL script.

Original comment by stewart....@gmail.com on 20 Mar 2012 at 11:27