Submitted by: IZ
You use the following query to detect the presence of the hstore
type in a database:
SELECT t.oid, %s
FROM pg_type t JOIN pg_namespace ns
ON typnamespace = ns.oid
WHERE typname = 'hstore' and nspname = 'public';
(lines 684-688 of psycopg2/extras.py, function get_oids(self,
conn_or_curs))
which is not entirely correct as hstore may be installed in
difference schema (but search_path modified properly so that every
client sees it), which is actually a good practice (experienced
PostgreSQL admins install contribs in their own schemas not to make
a big mess in public), though not default behaviour (hstore.sql by
default comes to public schema, yes). So I would encourage you to
remove "and nspname = 'public'" of the query above, unless you have
strong reasons to hold it there.
Many thanks to you for your great work.