mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-08-03 20:00:09 +03:00
Cast dict values to string before quoting them
The SQL hstore function requires key and value of type text.
This commit is contained in:
parent
497247a528
commit
5159326448
|
@ -644,7 +644,8 @@ class HstoreAdapter(object):
|
|||
|
||||
k = _ext.adapt(self.wrapped.keys())
|
||||
k.prepare(self.conn)
|
||||
v = _ext.adapt(self.wrapped.values())
|
||||
values = [str(v) for v in self.wrapped.values()]
|
||||
v = _ext.adapt(values)
|
||||
v.prepare(self.conn)
|
||||
return b("hstore(") + k.getquoted() + b(", ") + v.getquoted() + b(")")
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user