Something went wrong. Try again.
Something went wrong. Try again.
3.5 kB · 98 lines
SQL
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899BEGIN;-- Cache results once; querying inline per-assertion multiplies execution cost by N.CREATE TEMP TABLE _pgfa_func_results AS SELECT * FROM pg_firstAid();CREATE TEMP TABLE _pgfa_view_results AS SELECT * FROM v_pgfirstaid;SELECT plan(20);
SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'Database Size'), 'Function executes Database Size check');SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_view_results WHERE check_name = 'Database Size'), 'View executes Database Size check');
SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'PostgreSQL Version'), 'Function executes PostgreSQL Version check');SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_view_results WHERE check_name = 'PostgreSQL Version'), 'View executes PostgreSQL Version check');
SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'Installed Extension'), 'Function executes Installed Extension check');SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_view_results WHERE check_name = 'Installed Extension'), 'View executes Installed Extension check');
SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'Server Uptime'), 'Function executes Server Uptime check');SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_view_results WHERE check_name = 'Server Uptime'), 'View executes Server Uptime check');
SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'Is Logging Enabled'), 'Function executes Is Logging Enabled check');SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_view_results WHERE check_name = 'Is Logging Enabled'), 'View executes Is Logging Enabled check');
SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'Size of ALL Logfiles combined'), 'Function executes Size of ALL Logfiles combined check');SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_view_results WHERE check_name = 'Size of ALL Logfiles combined'), 'View executes Size of ALL Logfiles combined check');
SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'Varchar With Length Limit'), 'Function executes Varchar With Length Limit check');SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_view_results WHERE check_name = 'Varchar With Length Limit'), 'View executes Varchar With Length Limit check');
SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'Serial Column Legacy'), 'Function executes Serial Column Legacy check');SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_view_results WHERE check_name = 'Serial Column Legacy'), 'View executes Serial Column Legacy check');
SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'Rules On Tables'), 'Function executes Rules On Tables check');SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_view_results WHERE check_name = 'Rules On Tables'), 'View executes Rules On Tables check');
SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_func_results WHERE check_name = 'Not In With Subquery'), 'Function executes Not In With Subquery check when pg_stat_statements is installed');SELECT ok( (SELECT count(*) >= 0 FROM _pgfa_view_results WHERE check_name = 'Not In With Subquery'), 'View executes Not In With Subquery check when pg_stat_statements is installed');
SELECT * FROM finish();ROLLBACK;