title: postgres hstore exists and doesn't exist at same time
body: <p>I set up a Rails app on a remote server and created an hstore extension </p>
  
  <pre><code> sudo -u postgres psql
   CREATE EXTENSION hstore;
  </code></pre>
  
  <p>I then deployed an iteration of the app that uses hstore in one of the postgres tables, but when it ran the migrations it gave an error message</p>
  
  <pre><code>PG::UndefinedObject: ERROR:  type "hstore" does not exist
  </code></pre>
  
  <p>I then tried to do this again</p>
  
  <pre><code> sudo -u postgres psql
   CREATE EXTENSION hstore;
  </code></pre>
  
  <p>but it told me hstore already exists</p>
  
  <pre><code>ERROR:  extension "hstore" already exists
  </code></pre>
  
  <p>and this circle continued on. </p>
  
  <p>Any idea what might be causing this problem? I'm using postgres 9.1 on an Ubuntu 12.04 server</p>
  
  <p><strong>Update</strong>
  Note, wondering if this issue was related to permissions, I tried to check my permissions like this but got the following error</p>
  
  <pre><code>sudo -u postgres psql -U username
  psql: FATAL:  Peer authentication failed for user "username"
  </code></pre>
  
  <p><strong>Update</strong>
  Although hstore is installed, it's not an extension for the database I'm using. How to install it in a specific database?</p>
  
  <pre><code>psql -d db_production -c '\dx'
                   List of installed extensions
    Name   | Version |   Schema   |         Description          
  ---------+---------+------------+------------------------------
   plpgsql | 1.0     | pg_catalog | PL/pgSQL procedural language
  (1 row)
  </code></pre>