mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 09:24:07 +03:00
Added special cases to store empty dicts.
This commit is contained in:
parent
6d441b6e03
commit
70880dde79
|
@ -487,6 +487,9 @@ class HstoreAdapter(object):
|
|||
|
||||
def _getquoted_8(self):
|
||||
"""Use the operators available in PG pre-9.0."""
|
||||
if not self.wrapped:
|
||||
return "''::hstore"
|
||||
|
||||
adapt = _ext.adapt
|
||||
rv = []
|
||||
for k, v in self.wrapped.iteritems():
|
||||
|
@ -509,6 +512,9 @@ class HstoreAdapter(object):
|
|||
|
||||
def _getquoted_9(self):
|
||||
"""Use the hstore(text[], text[]) function."""
|
||||
if not self.wrapped:
|
||||
return "''::hstore"
|
||||
|
||||
k = _ext.adapt(self.wrapped.keys())
|
||||
k.prepare(self.conn)
|
||||
v = _ext.adapt(self.wrapped.values())
|
||||
|
|
Loading…
Reference in New Issue
Block a user