title: postgres migration error; unterminated dollar-quoted string
body: <p>Well this is abit strange, could anyone help me point out where this function may be wrong.
  I have a function similar to </p>
  
  <pre><code>CREATE FUNCTION check_password(uname TEXT, pass TEXT)
  RETURNS BOOLEAN AS $$
  DECLARE passed BOOLEAN;
  BEGIN
          SELECT  (pwd = $2) INTO passed
          FROM    pwds
          WHERE   username = $1;
  
          RETURN passed;
  END;
  
  $$  LANGUAGE plpgsql
  </code></pre>
  
  <p>When i run it directly in the pgAdmin sql console, there are no errors but running it in a migration script using db-migration-maven-plugin i get the error.</p>
  
  <pre><code>Error executing: CREATE FUNCTION check_password(uname TEXT, pass TEXT) 
                   RETURNS BOOLEAN AS $$ DECLARE passed BOOLEAN
  org.postgresql.util.PSQLException: ERROR: unterminated dollar-quoted 
                          string at or near "$$ DECLARE passed BOOLEAN"
  Position: 74
  </code></pre>