def register_hstore_typecaster(conn):
 with conn.cursor() as cur:
  try:
   cur.execute("SELECT 'hstore'::regtype::oid")
   oid = cur.fetchone()[0]
   ext.register_type(ext.new_type((oid,), 'HSTORE', ext.UNICODE))
  except Exception:
   pass

def register_hstore_typecaster ( conn ) : with conn . cursor ( ) as cur : try : cur . execute ( "SELECT 'hstore'::regtype::oid" ) oid = cur . fetchone ( ) [ 0 ] ext . register_type ( ext . new_type ( ( oid , ) , 'HSTORE' , ext . UNICODE ) ) except Exception : pass
instead of using register_hstore() which converts hstore into a python dict .