title: PostgreSQL function always returns: "cannot execute CREATE FUNCTION is a read-only transaction"
body: <p>I can't execute a function using PostgreSQL 9.4. It always returns:
  "Kernel error: cannot execute CREATE FUNCTION is a read-only transaction"
  How could I change that? I never specify READONLY in my code.</p>
  
  <p>Example of function I tried:</p>
  
  <pre><code>CREATE FUNCTION less_than(a TEXT, b TEXT) RETURNS BOOLEAN AS $$
  DECLARE
      local_a text := a;
      local_b text := b;
  BEGIN
      RETURN local_a &lt; local_b;
  END;
  $$ LANGUAGE plpgsql;
  </code></pre>
  
  <p>Thanks</p>