title: ERROR: unterminated quoted string at or near
body: <p>While executing below shown trigger code using ANT I am getting the error </p>
  
  <pre><code>org.postgresql.util.PSQLException: ERROR: unterminated quoted string at or near "' DECLARE timeout integer"
  Position: 57
  </code></pre>
  
  <p>I am able to sucessfully execute the below code through PGADmin (Provided by postgres) and command line utility "psql" and the trigger function is added but while executing through ANT it fails everytime</p>
  
  <pre><code>BEGIN TRANSACTION;
  
  CREATE OR REPLACE FUNCTION sweeper() RETURNS trigger as '
      DECLARE
      timeout integer;
      BEGIN
      timeout = 30 * 24 * 60 * 60 ;
          DELETE FROM diagnosticdata WHERE current_timestamp - teststarttime  &gt; (timeout * ''1 sec''::interval);
          return NEW;
      END;
  ' LANGUAGE 'plpgsql';
  
  -- Trigger: sweep on diagnosticdata
  
  CREATE TRIGGER sweep
    AFTER INSERT
    ON diagnosticdata
    FOR EACH ROW
    EXECUTE PROCEDURE sweeper();
  
  END;
  </code></pre>