register_hstore does DB queries, does not play well with async connections

From: Jan Urbański <wulczer(at)wulczer(dot)org>
To: Psycopg List <psycopg(at)postgresql(dot)org>
Subject: register_hstore does DB queries, does not play well with async connections
Date: 2011-02-20 22:08:44
Message-ID: 4D6190EC.60801@wulczer.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

Hi,

as per $SUBJECT. If you have an async connection and try to do
register_hstore, it does a query to get hstore's OID, and does not do
poll(), which results in an error in fetchone().

I think the solution is to allow people to pass the OID in
register_hstore and document that you have to do it if using async
connections. Currently I'm doing the select myself (asynchronously) and
monkeypatching HstoreAdapter's get_oids to just return the OID.

BTW: the query assumes you have hstore installed in the "public" schema,
which might not be correct... How about allowing passing the
fully-qualified type name to register_hstore?

Cheers,
Jan

Responses

Browse psycopg by date

  From Date Subject
Next Message Daniele Varrazzo 2011-02-21 09:24:59 Re: register_hstore does DB queries, does not play well with async connections
Previous Message Daniele Varrazzo 2011-02-20 18:06:30 Re: NULL dereference when memory is tight