-- General setup \set SHOW_CONTEXT never --Setup extension CREATE EXTENSION pg_stat_statements; CREATE EXTENSION btree_gist; CREATE EXTENSION powa; -- Aggregate data every 5 snapshots SET powa.coalesce = 5; -- Test created ojects SELECT * FROM powa_functions ORDER BY module, operation; srvid | module | operation | function_name | query_source | query_cleanup | added_manually | enabled | priority | extname -------+--------------------------+-----------+-------------------------------+-------------------------+---------------+----------------+---------+----------+-------------------- 0 | pg_stat_bgwriter | aggregate | powa_stat_bgwriter_aggregate | | | f | t | 10 | 0 | pg_stat_bgwriter | purge | powa_stat_bgwriter_purge | | | f | t | 10 | 0 | pg_stat_bgwriter | reset | powa_stat_bgwriter_reset | | | f | t | 10 | 0 | pg_stat_bgwriter | snapshot | powa_stat_bgwriter_snapshot | powa_stat_bgwriter_src | | f | t | 10 | 0 | pg_stat_statements | aggregate | powa_statements_aggregate | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | purge | powa_statements_purge | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | purge | powa_databases_purge | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | reset | powa_statements_reset | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | snapshot | powa_databases_snapshot | powa_databases_src | | f | t | -3 | pg_stat_statements 0 | pg_stat_statements | snapshot | powa_statements_snapshot | powa_statements_src | | f | t | -2 | pg_stat_statements 0 | powa_stat_all_relations | aggregate | powa_all_relations_aggregate | | | f | t | 10 | powa 0 | powa_stat_all_relations | purge | powa_all_relations_purge | | | f | t | 10 | powa 0 | powa_stat_all_relations | reset | powa_all_relations_reset | | | f | t | 10 | powa 0 | powa_stat_all_relations | snapshot | powa_all_relations_snapshot | powa_all_relations_src | | f | t | 10 | powa 0 | powa_stat_user_functions | aggregate | powa_user_functions_aggregate | | | f | t | 10 | powa 0 | powa_stat_user_functions | purge | powa_user_functions_purge | | | f | t | 10 | powa 0 | powa_stat_user_functions | reset | powa_user_functions_reset | | | f | t | 10 | powa 0 | powa_stat_user_functions | snapshot | powa_user_functions_snapshot | powa_user_functions_src | | f | t | 10 | powa (18 rows) -- test C SRFs SELECT COUNT(*) = 0 FROM pg_database, LATERAL powa_stat_user_functions(oid) f WHERE datname = current_database(); ?column? ---------- t (1 row) -- on pg15+ the function is a no-op, and this function will be deprecated soon -- anyway SELECT COUNT(*) >= 0 FROM pg_database, LATERAL powa_stat_all_rel(oid) WHERE datname = current_database(); ?column? ---------- t (1 row) -- Test snapshot SELECT 1, COUNT(*) = 0 FROM powa_user_functions_history_current; ?column? | ?column? ----------+---------- 1 | t (1 row) SELECT 1, COUNT(*) = 0 FROM powa_all_relations_history_current; ?column? | ?column? ----------+---------- 1 | t (1 row) SELECT 1, COUNT(*) = 0 FROM powa_statements_history_current; ?column? | ?column? ----------+---------- 1 | t (1 row) SELECT 1, COUNT(*) = 0 FROM powa_statements_history_current_db; ?column? | ?column? ----------+---------- 1 | t (1 row) SELECT 1, COUNT(*) = 0 FROM powa_user_functions_history; ?column? | ?column? ----------+---------- 1 | t (1 row) SELECT 1, COUNT(*) = 0 FROM powa_all_relations_history; ?column? | ?column? ----------+---------- 1 | t (1 row) SELECT 1, COUNT(*) = 0 FROM powa_statements_history; ?column? | ?column? ----------+---------- 1 | t (1 row) SELECT 1, COUNT(*) = 0 FROM powa_statements_history; ?column? | ?column? ----------+---------- 1 | t (1 row) SELECT powa_take_snapshot(); powa_take_snapshot -------------------- 0 (1 row) SELECT 2, COUNT(*) >= 0 FROM powa_user_functions_history_current; ?column? | ?column? ----------+---------- 2 | t (1 row) SELECT 2, COUNT(*) >= 0 FROM powa_all_relations_history_current; ?column? | ?column? ----------+---------- 2 | t (1 row) SELECT 2, COUNT(*) > 0 FROM powa_statements_history_current; ?column? | ?column? ----------+---------- 2 | t (1 row) SELECT 2, COUNT(*) > 0 FROM powa_statements_history_current_db; ?column? | ?column? ----------+---------- 2 | t (1 row) SELECT 2, COUNT(*) >= 0 FROM powa_user_functions_history; ?column? | ?column? ----------+---------- 2 | t (1 row) SELECT 2, COUNT(*) = 0 FROM powa_all_relations_history; ?column? | ?column? ----------+---------- 2 | t (1 row) SELECT 2, COUNT(*) = 0 FROM powa_statements_history; ?column? | ?column? ----------+---------- 2 | t (1 row) SELECT 2, COUNT(*) = 0 FROM powa_statements_history; ?column? | ?column? ----------+---------- 2 | t (1 row) SELECT powa_take_snapshot(); powa_take_snapshot -------------------- 0 (1 row) SELECT powa_take_snapshot(); powa_take_snapshot -------------------- 0 (1 row) SELECT powa_take_snapshot(); powa_take_snapshot -------------------- 0 (1 row) -- This snapshot will trigger the aggregate SELECT powa_take_snapshot(); powa_take_snapshot -------------------- 0 (1 row) SELECT 3, COUNT(*) >= 0 FROM powa_user_functions_history_current; ?column? | ?column? ----------+---------- 3 | t (1 row) SELECT 3, COUNT(*) >= 0 FROM powa_all_relations_history_current; ?column? | ?column? ----------+---------- 3 | t (1 row) SELECT 3, COUNT(*) > 0 FROM powa_statements_history_current; ?column? | ?column? ----------+---------- 3 | t (1 row) SELECT 3, COUNT(*) > 0 FROM powa_statements_history_current_db; ?column? | ?column? ----------+---------- 3 | t (1 row) SELECT 3, COUNT(*) >= 0 FROM powa_user_functions_history; ?column? | ?column? ----------+---------- 3 | t (1 row) SELECT 3, COUNT(*) >= 0 FROM powa_all_relations_history; ?column? | ?column? ----------+---------- 3 | t (1 row) SELECT 3, COUNT(*) > 0 FROM powa_statements_history; ?column? | ?column? ----------+---------- 3 | t (1 row) SELECT 3, COUNT(*) > 0 FROM powa_statements_history; ?column? | ?column? ----------+---------- 3 | t (1 row) -- Test reset function SELECT * from powa_reset(0); powa_reset ------------ t (1 row) SELECT 4, COUNT(*) = 0 FROM powa_user_functions_history_current; ?column? | ?column? ----------+---------- 4 | t (1 row) SELECT 4, COUNT(*) = 0 FROM powa_all_relations_history_current; ?column? | ?column? ----------+---------- 4 | t (1 row) SELECT 4, COUNT(*) = 0 FROM powa_statements_history_current; ?column? | ?column? ----------+---------- 4 | t (1 row) SELECT 4, COUNT(*) = 0 FROM powa_statements_history_current_db; ?column? | ?column? ----------+---------- 4 | t (1 row) SELECT 4, COUNT(*) = 0 FROM powa_user_functions_history; ?column? | ?column? ----------+---------- 4 | t (1 row) SELECT 4, COUNT(*) = 0 FROM powa_all_relations_history; ?column? | ?column? ----------+---------- 4 | t (1 row) SELECT 4, COUNT(*) = 0 FROM powa_statements_history; ?column? | ?column? ----------+---------- 4 | t (1 row) SELECT 4, COUNT(*) = 0 FROM powa_statements_history; ?column? | ?column? ----------+---------- 4 | t (1 row) -- Check API SELECT powa_register_server(hostname => '127.0.0.1', extensions => '{pg_qualstats}'); powa_register_server ---------------------- t (1 row) SELECT COUNT(*) FROM powa_servers; count ------- 2 (1 row) SELECT hostname FROM powa_servers WHERE id = 1; hostname ----------- 127.0.0.1 (1 row) -- Check missing powa_statements FK for pg_qualstats doesn't prevent snapshot INSERT INTO public.powa_qualstats_src_tmp(srvid, ts, uniquequalnodeid, dbid, userid, qualnodeid, occurences, execution_count, nbfiltered, mean_err_estimate_ratio, mean_err_estimate_num, queryid, constvalues, quals) SELECT 1, now(), 1, 1, 1, 1, 1000, 1, 0, 0, 0, 123456789, '{}', ARRAY[(1259,1,607,'i')::qual_type]; SELECT count(*) FROM public.powa_qualstats_src_tmp; count ------- 1 (1 row) SELECT public.powa_qualstats_snapshot(1); powa_qualstats_snapshot ------------------------- (1 row) SELECT count(*) FROM public.powa_qualstats_src_tmp; count ------- 0 (1 row) SELECT count(*) FROM public.powa_qualstats_quals_history_current WHERE srvid = 1; count ------- 0 (1 row) -- Check snapshot of regular quals INSERT INTO public.powa_databases(srvid, oid, datname, dropped) VALUES (1, 16384, 'postgres', NULL); INSERT INTO public.powa_statements(srvid, queryid, dbid, userid, query) VALUES(1, 123456789, 16384, 10, 'query with qual'); INSERT INTO public.powa_qualstats_src_tmp(srvid, ts, uniquequalnodeid, dbid, userid, qualnodeid, occurences, execution_count, nbfiltered, mean_err_estimate_ratio, mean_err_estimate_num, queryid, constvalues, quals) SELECT 1, now(), 1, 16384, 10, 1, 1000, 1, 0, 0, 0, 123456789, '{}', ARRAY[(1259,1,607,'i')::qual_type]; SELECT count(*) FROM public.powa_qualstats_src_tmp; count ------- 1 (1 row) SELECT public.powa_qualstats_snapshot(1); powa_qualstats_snapshot ------------------------- (1 row) SELECT count(*) FROM public.powa_qualstats_src_tmp; count ------- 0 (1 row) SELECT count(*) FROM public.powa_qualstats_quals_history_current WHERE srvid = 1; count ------- 1 (1 row) -- activate / deactivate extension SELECT * FROM public.powa_functions ORDER BY srvid, module, operation, function_name; srvid | module | operation | function_name | query_source | query_cleanup | added_manually | enabled | priority | extname -------+--------------------------+------------+-------------------------------+-------------------------+-----------------------------+----------------+---------+----------+-------------------- 0 | pg_stat_bgwriter | aggregate | powa_stat_bgwriter_aggregate | | | f | t | 10 | 0 | pg_stat_bgwriter | purge | powa_stat_bgwriter_purge | | | f | t | 10 | 0 | pg_stat_bgwriter | reset | powa_stat_bgwriter_reset | | | f | t | 10 | 0 | pg_stat_bgwriter | snapshot | powa_stat_bgwriter_snapshot | powa_stat_bgwriter_src | | f | t | 10 | 0 | pg_stat_statements | aggregate | powa_statements_aggregate | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | purge | powa_databases_purge | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | purge | powa_statements_purge | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | reset | powa_statements_reset | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | snapshot | powa_databases_snapshot | powa_databases_src | | f | t | -3 | pg_stat_statements 0 | pg_stat_statements | snapshot | powa_statements_snapshot | powa_statements_src | | f | t | -2 | pg_stat_statements 0 | powa_stat_all_relations | aggregate | powa_all_relations_aggregate | | | f | t | 10 | powa 0 | powa_stat_all_relations | purge | powa_all_relations_purge | | | f | t | 10 | powa 0 | powa_stat_all_relations | reset | powa_all_relations_reset | | | f | t | 10 | powa 0 | powa_stat_all_relations | snapshot | powa_all_relations_snapshot | powa_all_relations_src | | f | t | 10 | powa 0 | powa_stat_user_functions | aggregate | powa_user_functions_aggregate | | | f | t | 10 | powa 0 | powa_stat_user_functions | purge | powa_user_functions_purge | | | f | t | 10 | powa 0 | powa_stat_user_functions | reset | powa_user_functions_reset | | | f | t | 10 | powa 0 | powa_stat_user_functions | snapshot | powa_user_functions_snapshot | powa_user_functions_src | | f | t | 10 | powa 1 | pg_qualstats | aggregate | powa_qualstats_aggregate | | | t | t | 10 | pg_qualstats 1 | pg_qualstats | purge | powa_qualstats_purge | | | t | t | 10 | pg_qualstats 1 | pg_qualstats | reset | powa_qualstats_reset | | | t | t | 10 | pg_qualstats 1 | pg_qualstats | snapshot | powa_qualstats_snapshot | powa_qualstats_src | SELECT pg_qualstats_reset() | t | t | 10 | pg_qualstats 1 | pg_qualstats | unregister | powa_qualstats_unregister | | | t | t | 10 | pg_qualstats 1 | pg_stat_bgwriter | aggregate | powa_stat_bgwriter_aggregate | | | t | t | 10 | 1 | pg_stat_bgwriter | purge | powa_stat_bgwriter_purge | | | t | t | 10 | 1 | pg_stat_bgwriter | reset | powa_stat_bgwriter_reset | | | t | t | 10 | 1 | pg_stat_bgwriter | snapshot | powa_stat_bgwriter_snapshot | powa_stat_bgwriter_src | | t | t | 10 | 1 | pg_stat_statements | aggregate | powa_statements_aggregate | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | purge | powa_databases_purge | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | purge | powa_statements_purge | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | reset | powa_statements_reset | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | snapshot | powa_databases_snapshot | powa_databases_src | | t | t | -1 | pg_stat_statements 1 | pg_stat_statements | snapshot | powa_statements_snapshot | powa_statements_src | | t | t | 10 | pg_stat_statements 1 | powa_stat_all_relations | aggregate | powa_all_relations_aggregate | | | t | t | 10 | powa 1 | powa_stat_all_relations | purge | powa_all_relations_purge | | | t | t | 10 | powa 1 | powa_stat_all_relations | reset | powa_all_relations_reset | | | t | t | 10 | powa 1 | powa_stat_all_relations | snapshot | powa_all_relations_snapshot | powa_all_relations_src | | t | t | 10 | powa 1 | powa_stat_user_functions | aggregate | powa_user_functions_aggregate | | | t | t | 10 | powa 1 | powa_stat_user_functions | purge | powa_user_functions_purge | | | t | t | 10 | powa 1 | powa_stat_user_functions | reset | powa_user_functions_reset | | | t | t | 10 | powa 1 | powa_stat_user_functions | snapshot | powa_user_functions_snapshot | powa_user_functions_src | | t | t | 10 | powa (41 rows) SELECT * FROM public.powa_activate_extension(1, 'pg_stat_kcache'); powa_activate_extension ------------------------- t (1 row) SELECT * FROM public.powa_activate_extension(1, 'some_extension'); powa_activate_extension ------------------------- f (1 row) SELECT * FROM public.powa_functions ORDER BY srvid, module, operation, function_name; srvid | module | operation | function_name | query_source | query_cleanup | added_manually | enabled | priority | extname -------+--------------------------+------------+-------------------------------+-------------------------+-----------------------------+----------------+---------+----------+-------------------- 0 | pg_stat_bgwriter | aggregate | powa_stat_bgwriter_aggregate | | | f | t | 10 | 0 | pg_stat_bgwriter | purge | powa_stat_bgwriter_purge | | | f | t | 10 | 0 | pg_stat_bgwriter | reset | powa_stat_bgwriter_reset | | | f | t | 10 | 0 | pg_stat_bgwriter | snapshot | powa_stat_bgwriter_snapshot | powa_stat_bgwriter_src | | f | t | 10 | 0 | pg_stat_statements | aggregate | powa_statements_aggregate | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | purge | powa_databases_purge | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | purge | powa_statements_purge | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | reset | powa_statements_reset | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | snapshot | powa_databases_snapshot | powa_databases_src | | f | t | -3 | pg_stat_statements 0 | pg_stat_statements | snapshot | powa_statements_snapshot | powa_statements_src | | f | t | -2 | pg_stat_statements 0 | powa_stat_all_relations | aggregate | powa_all_relations_aggregate | | | f | t | 10 | powa 0 | powa_stat_all_relations | purge | powa_all_relations_purge | | | f | t | 10 | powa 0 | powa_stat_all_relations | reset | powa_all_relations_reset | | | f | t | 10 | powa 0 | powa_stat_all_relations | snapshot | powa_all_relations_snapshot | powa_all_relations_src | | f | t | 10 | powa 0 | powa_stat_user_functions | aggregate | powa_user_functions_aggregate | | | f | t | 10 | powa 0 | powa_stat_user_functions | purge | powa_user_functions_purge | | | f | t | 10 | powa 0 | powa_stat_user_functions | reset | powa_user_functions_reset | | | f | t | 10 | powa 0 | powa_stat_user_functions | snapshot | powa_user_functions_snapshot | powa_user_functions_src | | f | t | 10 | powa 1 | pg_qualstats | aggregate | powa_qualstats_aggregate | | | t | t | 10 | pg_qualstats 1 | pg_qualstats | purge | powa_qualstats_purge | | | t | t | 10 | pg_qualstats 1 | pg_qualstats | reset | powa_qualstats_reset | | | t | t | 10 | pg_qualstats 1 | pg_qualstats | snapshot | powa_qualstats_snapshot | powa_qualstats_src | SELECT pg_qualstats_reset() | t | t | 10 | pg_qualstats 1 | pg_qualstats | unregister | powa_qualstats_unregister | | | t | t | 10 | pg_qualstats 1 | pg_stat_bgwriter | aggregate | powa_stat_bgwriter_aggregate | | | t | t | 10 | 1 | pg_stat_bgwriter | purge | powa_stat_bgwriter_purge | | | t | t | 10 | 1 | pg_stat_bgwriter | reset | powa_stat_bgwriter_reset | | | t | t | 10 | 1 | pg_stat_bgwriter | snapshot | powa_stat_bgwriter_snapshot | powa_stat_bgwriter_src | | t | t | 10 | 1 | pg_stat_kcache | aggregate | powa_kcache_aggregate | | | t | t | 10 | pg_stat_kcache 1 | pg_stat_kcache | purge | powa_kcache_purge | | | t | t | 10 | pg_stat_kcache 1 | pg_stat_kcache | reset | powa_kcache_reset | | | t | t | 10 | pg_stat_kcache 1 | pg_stat_kcache | snapshot | powa_kcache_snapshot | powa_kcache_src | | t | t | -1 | pg_stat_kcache 1 | pg_stat_kcache | unregister | powa_kcache_unregister | | | t | t | 10 | pg_stat_kcache 1 | pg_stat_statements | aggregate | powa_statements_aggregate | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | purge | powa_databases_purge | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | purge | powa_statements_purge | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | reset | powa_statements_reset | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | snapshot | powa_databases_snapshot | powa_databases_src | | t | t | -1 | pg_stat_statements 1 | pg_stat_statements | snapshot | powa_statements_snapshot | powa_statements_src | | t | t | 10 | pg_stat_statements 1 | powa_stat_all_relations | aggregate | powa_all_relations_aggregate | | | t | t | 10 | powa 1 | powa_stat_all_relations | purge | powa_all_relations_purge | | | t | t | 10 | powa 1 | powa_stat_all_relations | reset | powa_all_relations_reset | | | t | t | 10 | powa 1 | powa_stat_all_relations | snapshot | powa_all_relations_snapshot | powa_all_relations_src | | t | t | 10 | powa 1 | powa_stat_user_functions | aggregate | powa_user_functions_aggregate | | | t | t | 10 | powa 1 | powa_stat_user_functions | purge | powa_user_functions_purge | | | t | t | 10 | powa 1 | powa_stat_user_functions | reset | powa_user_functions_reset | | | t | t | 10 | powa 1 | powa_stat_user_functions | snapshot | powa_user_functions_snapshot | powa_user_functions_src | | t | t | 10 | powa (46 rows) SELECT * FROM public.powa_deactivate_extension(1, 'pg_stat_kcache'); powa_deactivate_extension --------------------------- t (1 row) SELECT * FROM public.powa_deactivate_extension(1, 'some_extension'); powa_deactivate_extension --------------------------- t (1 row) SELECT * FROM public.powa_functions ORDER BY srvid, module, operation, function_name; srvid | module | operation | function_name | query_source | query_cleanup | added_manually | enabled | priority | extname -------+--------------------------+------------+-------------------------------+-------------------------+-----------------------------+----------------+---------+----------+-------------------- 0 | pg_stat_bgwriter | aggregate | powa_stat_bgwriter_aggregate | | | f | t | 10 | 0 | pg_stat_bgwriter | purge | powa_stat_bgwriter_purge | | | f | t | 10 | 0 | pg_stat_bgwriter | reset | powa_stat_bgwriter_reset | | | f | t | 10 | 0 | pg_stat_bgwriter | snapshot | powa_stat_bgwriter_snapshot | powa_stat_bgwriter_src | | f | t | 10 | 0 | pg_stat_statements | aggregate | powa_statements_aggregate | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | purge | powa_databases_purge | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | purge | powa_statements_purge | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | reset | powa_statements_reset | | | f | t | 10 | pg_stat_statements 0 | pg_stat_statements | snapshot | powa_databases_snapshot | powa_databases_src | | f | t | -3 | pg_stat_statements 0 | pg_stat_statements | snapshot | powa_statements_snapshot | powa_statements_src | | f | t | -2 | pg_stat_statements 0 | powa_stat_all_relations | aggregate | powa_all_relations_aggregate | | | f | t | 10 | powa 0 | powa_stat_all_relations | purge | powa_all_relations_purge | | | f | t | 10 | powa 0 | powa_stat_all_relations | reset | powa_all_relations_reset | | | f | t | 10 | powa 0 | powa_stat_all_relations | snapshot | powa_all_relations_snapshot | powa_all_relations_src | | f | t | 10 | powa 0 | powa_stat_user_functions | aggregate | powa_user_functions_aggregate | | | f | t | 10 | powa 0 | powa_stat_user_functions | purge | powa_user_functions_purge | | | f | t | 10 | powa 0 | powa_stat_user_functions | reset | powa_user_functions_reset | | | f | t | 10 | powa 0 | powa_stat_user_functions | snapshot | powa_user_functions_snapshot | powa_user_functions_src | | f | t | 10 | powa 1 | pg_qualstats | aggregate | powa_qualstats_aggregate | | | t | t | 10 | pg_qualstats 1 | pg_qualstats | purge | powa_qualstats_purge | | | t | t | 10 | pg_qualstats 1 | pg_qualstats | reset | powa_qualstats_reset | | | t | t | 10 | pg_qualstats 1 | pg_qualstats | snapshot | powa_qualstats_snapshot | powa_qualstats_src | SELECT pg_qualstats_reset() | t | t | 10 | pg_qualstats 1 | pg_qualstats | unregister | powa_qualstats_unregister | | | t | t | 10 | pg_qualstats 1 | pg_stat_bgwriter | aggregate | powa_stat_bgwriter_aggregate | | | t | t | 10 | 1 | pg_stat_bgwriter | purge | powa_stat_bgwriter_purge | | | t | t | 10 | 1 | pg_stat_bgwriter | reset | powa_stat_bgwriter_reset | | | t | t | 10 | 1 | pg_stat_bgwriter | snapshot | powa_stat_bgwriter_snapshot | powa_stat_bgwriter_src | | t | t | 10 | 1 | pg_stat_kcache | aggregate | powa_kcache_aggregate | | | t | f | 10 | pg_stat_kcache 1 | pg_stat_kcache | purge | powa_kcache_purge | | | t | f | 10 | pg_stat_kcache 1 | pg_stat_kcache | reset | powa_kcache_reset | | | t | f | 10 | pg_stat_kcache 1 | pg_stat_kcache | snapshot | powa_kcache_snapshot | powa_kcache_src | | t | f | -1 | pg_stat_kcache 1 | pg_stat_kcache | unregister | powa_kcache_unregister | | | t | f | 10 | pg_stat_kcache 1 | pg_stat_statements | aggregate | powa_statements_aggregate | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | purge | powa_databases_purge | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | purge | powa_statements_purge | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | reset | powa_statements_reset | | | t | t | 10 | pg_stat_statements 1 | pg_stat_statements | snapshot | powa_databases_snapshot | powa_databases_src | | t | t | -1 | pg_stat_statements 1 | pg_stat_statements | snapshot | powa_statements_snapshot | powa_statements_src | | t | t | 10 | pg_stat_statements 1 | powa_stat_all_relations | aggregate | powa_all_relations_aggregate | | | t | t | 10 | powa 1 | powa_stat_all_relations | purge | powa_all_relations_purge | | | t | t | 10 | powa 1 | powa_stat_all_relations | reset | powa_all_relations_reset | | | t | t | 10 | powa 1 | powa_stat_all_relations | snapshot | powa_all_relations_snapshot | powa_all_relations_src | | t | t | 10 | powa 1 | powa_stat_user_functions | aggregate | powa_user_functions_aggregate | | | t | t | 10 | powa 1 | powa_stat_user_functions | purge | powa_user_functions_purge | | | t | t | 10 | powa 1 | powa_stat_user_functions | reset | powa_user_functions_reset | | | t | t | 10 | powa 1 | powa_stat_user_functions | snapshot | powa_user_functions_snapshot | powa_user_functions_src | | t | t | 10 | powa (46 rows) SELECT alias FROM public.powa_servers WHERE id = 1; alias ------- (1 row) SELECT * FROM public.powa_configure_server(0, '{"somekey": "someval"}'); ERROR: Local server cannot be configured SELECT * FROM public.powa_configure_server(1, '{"somekey": "someval"}'); ERROR: Unknown field: somekey SELECT * FROM public.powa_configure_server(1, '{"alias": "test server"}'); powa_configure_server ----------------------- t (1 row) SELECT alias FROM public.powa_servers WHERE id = 1; alias ------------- test server (1 row) -- Test reset function SELECT * from powa_reset(1); powa_reset ------------ t (1 row) -- Check remote server removal DELETE FROM public.powa_servers WHERE id = 1;