title: What does $$ mean when using DO, CREATE FUNCTION, etc?
body: <p>I have seen the double dollar sign ($$) being used often in FUNCTION declarations and while doing declare statements. I acknowledge that it is probably some syntax related feature, but I am not too clear how/why to use it and when.</p>
  
  <p>Code examples of usage below:</p>
  
  <pre><code>CREATE OR REPLACE FUNCTION BuildFunction(IN prefix TEXT, IN func_id INTEGER) RETURNS BOOLEAN AS $$
  BEGIN
  ...
  END; $$
  </code></pre>
  
  <p>Point of confusion, how do you return a boolean as a $$, is it some special type or something?</p>
  
  <pre><code>DO $$
  DECLARE  
     a integer := 10;  
     b integer := 20;  
     c integer;  
  BEGIN  
     c := a + b;
      RAISE NOTICE'Value of c: %', c;
  END $$;
  </code></pre>
  
  <p>This code snippet is from <a href="https://stackoverflow.com/questions/766657/how-do-you-use-variables-in-a-simple-postgresql-script">How do you use variables in a simple PostgreSQL script?</a></p>