treasure-data/prestogres — pull request #1 by frsyuki (2014-01-16 23:46:12+00:00)
Title: Forward error from PostgreSQL to clients

This changes to pgpool-II forward error messages from PostgreSQL to clients rather than closing a connection.

Design:

* `run_and_rewrite_presto_query()` runs `SELECT run_presto_as_temp_table(...)` query.
* If it succeeded, it rewrites a query to `select * from presto_result` as usual.
* If it failed, it rewrites a query to `do $$ begin raise exception '%', E'...'; end $$ language plpgsql`. It raises an exception and client get an error message.