Revision 6220
Added by Aaron Marcuse-Kubitza about 12 years ago
lib/sql_io.py | ||
---|---|---|
354 | 354 |
''' |
355 | 355 |
import psycopg2.extensions |
356 | 356 |
|
357 |
# Special handling for functions with hstore params |
|
358 |
if out_table == '_map': |
|
359 |
import psycopg2.extras |
|
360 |
psycopg2.extras.register_hstore(db.db) |
|
361 |
|
|
362 |
# Parse args |
|
363 |
try: value = mapping.pop('value') |
|
364 |
except KeyError: return None # value required |
|
365 |
|
|
366 |
mapping = dict(map=mapping, value=value) # non-value params -> hstore |
|
367 |
|
|
357 | 368 |
out_table = sql_gen.as_Table(out_table) |
358 | 369 |
|
359 | 370 |
def log_debug(msg): db.log_debug(msg, level=1.5) |
Also available in: Unified diff
sql_io.py: put_table(): Added special handling for functions with hstore params. Note that although _map() doesn't exist yet as a DB function, this code must be in place before _map() is created to avoid param type mismatch errors.