-- Calling run_isok_queries() without an argument runs all the queries. -- Use a transaction to keep from altering ISOK_RESULTS. BEGIN; -- Show the queries that should run SELECT iqname, query FROM isok_queries ORDER BY iqname; iqname | query -------------+---------------------------------------------------- errorquery2 | VALUES ('R4', 'Result number 4', NULL) + | , ('R5', 'Result number 5', NULL) + | , ('R6', 'Result number 6', NULL); query1 | VALUES ('R1', 'Result number 1', NULL) + | , ('R2', 'Result number 2', NULL) + | , ('R3', 'Result number 3', NULL); (2 rows) -- Omit the role, search_path, and (non-NULL) timestamps from the -- column list, they change and cause the test to fail. -- Output the expected 6 rows from the 2 executed queries. SELECT irid, iqname, deferred_to, category , keep_until, qr_id, qr_message, qr_extra, notes FROM run_isok_queries() AS riq ORDER BY riq.irid; irid | iqname | deferred_to | category | keep_until | qr_id | qr_message | qr_extra | notes ------+-------------+-------------+----------+------------+-------+-----------------+----------+------- 1 | errorquery2 | | | | R4 | Result number 4 | | 2 | errorquery2 | | | | R5 | Result number 5 | | 3 | errorquery2 | | | | R6 | Result number 6 | | 4 | query1 | | | | R1 | Result number 1 | | 5 | query1 | | | | R2 | Result number 2 | | 6 | query1 | | | | R3 | Result number 3 | | (6 rows) ROLLBACK; -- Cleanup -- Reset the sequence so what this test did is ignored. SELECT setval('isok_results_irid_seq', 1, FALSE); setval -------- 1 (1 row)