If you're using multiple different schemas, I suggest putting hstore
in its own and ensuring it is always on the search_path
. You might not want public
on your search_path
at all times, and it's nice to keep things compartmentalized.
CREATE SCHEMA hstore;
CREATE EXTENSION hstore WITH SCHEMA hstore;
... then either amend your search_path
consistently, or just always schema-qualify everything, using hstore.hstore
as the type name, OPERATOR(hstore.->)
. E.g.
SELECT hstore.hstore('"x" => "42"') OPERATOR(hstore.->) "x"
Alternately, it's safe to install hstore
into pg_catalog
:
CREATE EXTENSION hstore WITH SCHEMA pg_catalog;
pg_catalog
is always implicitly on the search path.