- try:
- psycopg2.extras.register_hstore(self.driver, globally=False, unicode=True)
- except psycopg2.ProgrammingError, e:
- pass
+ hstore = cache['hstore']
+ if hstore == None:
+ hstore = psycopg2.extras.HstoreAdapter.get_oids(self.driver)
+ if hstore != None:
+ hstore = hstore[0]
+
+ if hstore != None:
+ try:
+ psycopg2.extras.register_hstore(self.driver, globally=False, unicode=True, oid=hstore)
+ except psycopg2.ProgrammingError, e:
+ pass
+
+ if not cached:
+ dsn['cache'] = cache