1 /* src/test/modules/injection_points/injection_points--1.0.sql */
3 -- complain if script is sourced in psql, rather than via CREATE EXTENSION
4 \echo Use "CREATE EXTENSION injection_points" to load this file. \quit
7 -- injection_points_attach()
9 -- Attaches the action to the given injection point.
11 CREATE FUNCTION injection_points_attach(IN point_name TEXT,
14 AS 'MODULE_PATHNAME', 'injection_points_attach'
15 LANGUAGE C STRICT PARALLEL UNSAFE;
18 -- injection_points_load()
20 -- Load an injection point already attached.
22 CREATE FUNCTION injection_points_load(IN point_name TEXT)
24 AS 'MODULE_PATHNAME', 'injection_points_load'
25 LANGUAGE C STRICT PARALLEL UNSAFE;
28 -- injection_points_run()
30 -- Executes the action attached to the injection point.
32 CREATE FUNCTION injection_points_run(IN point_name TEXT)
34 AS 'MODULE_PATHNAME', 'injection_points_run'
35 LANGUAGE C STRICT PARALLEL UNSAFE;
38 -- injection_points_cached()
40 -- Executes the action attached to the injection point, from local cache.
42 CREATE FUNCTION injection_points_cached(IN point_name TEXT)
44 AS 'MODULE_PATHNAME', 'injection_points_cached'
45 LANGUAGE C STRICT PARALLEL UNSAFE;
48 -- injection_points_wakeup()
50 -- Wakes up a waiting injection point.
52 CREATE FUNCTION injection_points_wakeup(IN point_name TEXT)
54 AS 'MODULE_PATHNAME', 'injection_points_wakeup'
55 LANGUAGE C STRICT PARALLEL UNSAFE;
58 -- injection_points_set_local()
60 -- Trigger switch to link any future injection points attached to the
61 -- current process, useful to make SQL tests concurrently-safe.
63 CREATE FUNCTION injection_points_set_local()
65 AS 'MODULE_PATHNAME', 'injection_points_set_local'
66 LANGUAGE C STRICT PARALLEL UNSAFE;
69 -- injection_points_detach()
71 -- Detaches the current action, if any, from the given injection point.
73 CREATE FUNCTION injection_points_detach(IN point_name TEXT)
75 AS 'MODULE_PATHNAME', 'injection_points_detach'
76 LANGUAGE C STRICT PARALLEL UNSAFE;
79 -- injection_points_stats_numcalls()
81 -- Reports statistics, if any, related to the given injection point.
83 CREATE FUNCTION injection_points_stats_numcalls(IN point_name TEXT)
85 AS 'MODULE_PATHNAME', 'injection_points_stats_numcalls'
89 -- injection_points_stats_fixed()
91 -- Reports fixed-numbered statistics for injection points.
92 CREATE FUNCTION injection_points_stats_fixed(OUT numattach int8,
98 AS 'MODULE_PATHNAME', 'injection_points_stats_fixed'