First of all, it may look like a duplicate:
postgres hstore exists and does not exist at the same time
but this is not so. Although in this case I get the same error message. When you check if hstore is installed in the database, we see that it is:
./psql -d photographerio_development -c '\dx'
List of installed extensions
Name | Version | Schema | Description
---------+---------+------------+--------------------------------------------------
hstore | 1.2 | hstore | data type for storing sets of (key, value) pairs
plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language
and it is also in the template_1 database.
So, when I try to migrate to add hstore, I get PG::Error: ERROR: extension "hstore" already exists, and when I comment on this migration, on the next one that requires hstore, she says PG::UndefinedObject: ERROR: type "hstore" does not existthat is a bit of a paradox.
This is a Rails 4.0.1 application with postgresql 9, and I have hstore working on several other projects running on this computer.