-- Test that the system reports a sensible error when the supplied -- query is not a valid query. -- This is something of a vanity test, because we already test -- the exceptions. BEGIN; -- Update the query to something broken UPDATE isok_queries SET query = $$bad sql;$$ WHERE iqname = 'query1'; -- See that the error is trapped SELECT * FROM run_isok_queries($$VALUES ('query1');$$) ORDER BY irid; ERROR: run_isok_queries: Error executing stored ISOK_QUERIES.Query DETAIL: Problem in the saved query with IQName = (query1): The error is: syntax error at or near "bad" The query is: bad sql; Additional diagnostic information: PL/pgSQL function run_isok_queries(text) line 182 at FOR over EXECUTE statement CONTEXT: PL/pgSQL function run_isok_queries(text) line 396 at RAISE ROLLBACK; -- Cleanup -- Reset the sequence so what this test did is ignored. SELECT setval('isok_results_irid_seq', 1, FALSE); setval -------- 1 (1 row)