Skip site navigation (1) Skip section navigation (2)

hstores in pl/python

From: Jan Urbański <wulczer(at)wulczer(dot)org>
To: Postgres - Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: hstores in pl/python
Date: 2010-12-13 07:50:50
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
It would be cool to be able to transparently use hstores as Python
dictionaries and vice versa. It would be easy enough with hstore as a
core type, but with hstore as an addon it's not that easy.

There was talk about including hstore in core, is there still chance for
that to happen in 9.1? I'd like to include hstore<->dict handling, but
with hstore out-of-core the only half-sane way I see is:
 * hack PL/Python's makefile to add -Icontrib/hstore (yuck!)
 * create an extension module for Python that knows how to handle
hstores that would live next to
 * install it in $libdir on make install
 * when PL/Python receives or is asked to create an hstore, load the
extension module and use it to parse the value (ugly, probably slow)
 * the module would also have to make sure is loaded in the
database, which in itself is not pretty, as it would refer to
hstore_in/out symbols

I wrote a module that can be used with current PL/Python to simplify
hstore handling (, but it suffers
from most of the aforementioned problems, and on top of that you get
hstore->text->dict instead of just hstore->dict, which sucks.



pgsql-hackers by date

Next:From: Heikki LinnakangasDate: 2010-12-13 08:01:29
Subject: Re: pg_archivecleanup should remove WAL files also in pg_xlog?
Previous:From: Fujii MasaoDate: 2010-12-13 07:50:13
Subject: Re: pg_archivecleanup should remove WAL files also in pg_xlog?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group