This project is archived and is in readonly mode.

#45 ✓resolved
Psycopg website

Incorrect hstore oid query

Reported by Psycopg website | February 24th, 2011 @ 07:16 PM

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.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="https://github.com/psycopg/psycopg2/issues">the new tracker</a>.
<br/>
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins

People watching this ticket

Pages