title: Postgres UUID type error
body: <p>I'm trying to create a UUID id in a table with PostgreSQL. I tried with: </p>
  
  <pre><code>id uuid PRIMARY KEY DEFAULT uuid_generate_v4()
  </code></pre>
  
  <p>But I get: </p>
  
  <blockquote>
    <p>ERROR:  function uuid_generate_v4() does not exist 
    HINT:  No function matches the given name and argument types. You might need to add explicit type casts.</p>
  </blockquote>
  
  <p>I tried with adding the schema like: <code>id uuid PRIMARY KEY DEFAULT public.uuid_generate_v4()</code> (as seen in a comment <a href="https://stackoverflow.com/questions/12505158/generating-a-uuid-in-postgres-for-insert-statement#12505220">here</a>)</p>
  
  <p>I also checked if the extension is there (<code>SELECT * FROM pg_available_extensions;</code>), and yes I have it installed in the PostgreSQL database:</p>
  
  <p><a href="https://i.stack.imgur.com/VjNF2.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VjNF2.png" alt="enter image description here"></a></p>
  
  <p>I read that if the Postgres is runing in <code>--single</code> mode, this may not work, but I don't know how to test it or if there is any way to do it.</p>
  
  <p>Somebody knows how I can resolve the problem? Or any other option?
  Is it a good idea to use like this:</p>
  
  <pre><code>SET DEFAULT uuid_in(md5(random()::text || now()::text)::cstring);
  </code></pre>