It works with python 2.6.

I try to use prestogres at Centos 6.5.

The following error occurs.

$ psql -h localhost -p 9900 -U pg postgres
postgres=# SELECT * FROM sys.node;
ERROR:  ValueError: zero length field name in format

postgres/pg_log/postgresql-[...].log

< 2014-06-18 20:43:22.670 JST >ERROR:  ValueError: zero length field name in format
< 2014-06-18 20:43:22.670 JST >CONTEXT:  Traceback (most recent call last):
          PL/Python function "run_presto_as_temp_table", line 3, in <module>
            prestogres.run_presto_as_temp_table(server, user, catalog, schema, table_name, query)
          PL/Python function "run_presto_as_temp_table", line 202, in run_presto_as_temp_table
          PL/Python function "run_presto_as_temp_table", line 124, in _batch_insert
          PL/Python function "run_presto_as_temp_table", line 105, in _plan_batch
        PL/Python function "run_presto_as_temp_table"
< 2014-06-18 20:43:22.670 JST >STATEMENT:  select prestogres_catalog.run_presto_as_temp_table(E'localhost:8080', E'pg', E'hive', E'postgres', E'presto_result', E'SELECT * FROM sys.node limit 1000')
< 2014-06-18 20:43:22.671 JST >ERROR:  ValueError: zero length field name in format
< 2014-06-18 20:43:22.671 JST >STATEMENT:  do $$ begin raise exception '%', E'ValueError: zero length field name in format' using errcode = E'XX000'; end $$ language plpgsql

Default python of Centos 6.5  is python 2.6.

Python 2.6 requires the field numbers(for example, {0}). In Python 2.7 and later, they can be omitted(for example, {}).

ref:http://stackoverflow.com/questions/5446964/valueerror-zero-length-field-name-in-format-error-in-python-3-0-3-1-3-2

I don't know how to work prestogres with python 2.7 and later.
prestogres depends postgresql93-plpython
fixed rewrite_error_query
Merge pull request #7 from wyukawa/feature-readme

prestogres depends postgresql93-plpython
Update README.md
Merge pull request #8 from wyukawa/feature-python2.6

prestogres works with python 2.6
updated _plan_batch
updated _plan_batch