| CREATE FUNCTION f1() RETURNS BOOLEAN |
| AS |
| ' |
| BEGIN |
| RETURN true; |
| END |
| ' LANGUAGE 'plpgsql'; |
| CREATE FUNCTION |
| SELECT f1(); |
| f1 |
| ---- |
| t |
| (1 row) |
| |
| SELECT pg_sleep(1); |
| pg_sleep |
| ---------- |
| |
| (1 row) |
| |
| SELECT pgperf.create_snapshot_pg_stat_user_functions(0); |
| create_snapshot_pg_stat_user_functions |
| ---------------------------------------- |
| t |
| (1 row) |
| |
| SELECT count(*) FROM pgperf.snapshot_pg_stat_user_functions WHERE schemaname <> 'pgperf'; |
| count |
| ------- |
| 3 |
| (1 row) |
| |
| SELECT pgperf.create_snapshot_pg_stat_user_functions(1); |
| create_snapshot_pg_stat_user_functions |
| ---------------------------------------- |
| t |
| (1 row) |
| |
| SELECT count(*) FROM pgperf.snapshot_pg_stat_user_functions WHERE schemaname <> 'pgperf'; |
| count |
| ------- |
| 6 |
| (1 row) |
| |
| SELECT pgperf.create_snapshot_pg_stat_user_functions(2); |
| create_snapshot_pg_stat_user_functions |
| ---------------------------------------- |
| t |
| (1 row) |
| |
| SELECT count(*) FROM pgperf.snapshot_pg_stat_user_functions WHERE schemaname <> 'pgperf'; |
| count |
| ------- |
| 9 |
| (1 row) |
| |
| SELECT pgperf.delete_snapshot_pg_stat_user_functions(1); |
| delete_snapshot_pg_stat_user_functions |
| ---------------------------------------- |
| t |
| (1 row) |
| |
| SELECT count(*) FROM pgperf.snapshot_pg_stat_user_functions WHERE schemaname <> 'pgperf'; |
| count |
| ------- |
| 6 |
| (1 row) |
| |
| SELECT pgperf.delete_snapshot_pg_stat_user_functions(2); |
| delete_snapshot_pg_stat_user_functions |
| ---------------------------------------- |
| t |
| (1 row) |
| |
| SELECT count(*) FROM pgperf.snapshot_pg_stat_user_functions WHERE schemaname <> 'pgperf'; |
| count |
| ------- |
| 3 |
| (1 row) |
| |
| SELECT pgperf.delete_snapshot_pg_stat_user_functions(0); |
| delete_snapshot_pg_stat_user_functions |
| ---------------------------------------- |
| t |
| (1 row) |
| |
| SELECT count(*) FROM pgperf.snapshot_pg_stat_user_functions WHERE schemaname <> 'pgperf'; |
| count |
| ------- |
| 0 |
| (1 row) |
| |
| DROP FUNCTION f1(); |
| DROP FUNCTION |