title: What are '$$' used for in PL/pgSQL
body: <p>Being completely new to PL/pgSQL , what is the meaning of double dollar signs in <a href="http://postgres.cz/wiki/PL/pgSQL_%28en%29" rel="noreferrer">this function</a>:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION check_phone_number(text)
  RETURNS boolean AS $$
  BEGIN
    IF NOT $1 ~  e'^\\+\\d{3}\\ \\d{3} \\d{3} \\d{3}$' THEN
      RAISE EXCEPTION 'Wrong formated string "%". Expected format is +999 999';
    END IF;
    RETURN true; 
  END;
  $$ LANGUAGE plpgsql STRICT IMMUTABLE;
  </code></pre>
  
  <p>I'm guessing that, in <code>RETURNS boolean AS $$</code>, <code>$$</code> is a placeholder.</p>
  
  <p>The last line is a bit of a mystery: <code>$$ LANGUAGE plpgsql STRICT IMMUTABLE;</code></p>
  
  <p>By the way, what does the last line mean?</p>