Re: hstores in pl/python - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: hstores in pl/python
Date
Msg-id m2fwtyrdb6.fsf@2ndQuadrant.fr
Whole thread Raw
In response to Re: hstores in pl/python  (Florian Pflug <fgp@phlo.org>)
Responses Re: hstores in pl/python
List pgsql-hackers
Florian Pflug <fgp@phlo.org> writes:
> Not if CREATE EXTENSION allows you install hstore into an arbitrary schema.

It also allows you to change it after the fact, and to easily track it
down. Here's an updated version of the query to find the hstore type OID
reliably once we have extensions in:

dim=# SELECT t.oid       FROM pg_extension_objects('hstore') o            JOIN pg_type t ON t.oid = o.objid
             AND o.classid = 'pg_type'::regclass       WHERE t.typname = 'hstore'; oid   
-------16393
(1 row)

For listing all the hstore objects interactively, use \dx hstore.

> For pl/python's purposes, requiring the DBA to set plpython_hstore_type
> accordingly might work, but clients need to be able to reliably find hstore
> too. For them, having to specify the schema of every non-core type your
> database adapter might support isn't exactly ideal...

Another reason why you will like the extension's patch :)

If you think you need the schema where the extension's objects are
living, there it is (for interactive use, just issue \dx):

=# SELECT n.nspname, e.extname    FROM pg_catalog.pg_extension e         LEFT JOIN pg_catalog.pg_depend d ON d.objid =
e.oid               AND d.refclassid = 'pg_catalog.pg_namespace'::regclass          LEFT JOIN pg_catalog.pg_namespace n
ONn.oid = d.refobjid    WHERE extname = 'hstore';nspname | extname  
---------+---------utils   | hstore
(1 row)


--
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Complier warnings on mingw gcc 4.5.0
Next
From: Jeff Janes
Date:
Subject: Re: BufFreelistLock