|
| 1 | +CREATE EXTENSION injection_points; |
| 2 | +SELECT injection_points_attach('TestInjectionBooh', 'booh'); |
| 3 | +ERROR: incorrect action "booh" for injection point creation |
| 4 | +SELECT injection_points_attach('TestInjectionError', 'error'); |
| 5 | + injection_points_attach |
| 6 | +------------------------- |
| 7 | + |
| 8 | +(1 row) |
| 9 | + |
| 10 | +SELECT injection_points_attach('TestInjectionLog', 'notice'); |
| 11 | + injection_points_attach |
| 12 | +------------------------- |
| 13 | + |
| 14 | +(1 row) |
| 15 | + |
| 16 | +SELECT injection_points_attach('TestInjectionLog2', 'notice'); |
| 17 | + injection_points_attach |
| 18 | +------------------------- |
| 19 | + |
| 20 | +(1 row) |
| 21 | + |
| 22 | +SELECT injection_points_run('TestInjectionBooh'); -- nothing |
| 23 | + injection_points_run |
| 24 | +---------------------- |
| 25 | + |
| 26 | +(1 row) |
| 27 | + |
| 28 | +SELECT injection_points_run('TestInjectionLog2'); -- notice |
| 29 | +NOTICE: notice triggered for injection point TestInjectionLog2 |
| 30 | + injection_points_run |
| 31 | +---------------------- |
| 32 | + |
| 33 | +(1 row) |
| 34 | + |
| 35 | +SELECT injection_points_run('TestInjectionLog'); -- notice |
| 36 | +NOTICE: notice triggered for injection point TestInjectionLog |
| 37 | + injection_points_run |
| 38 | +---------------------- |
| 39 | + |
| 40 | +(1 row) |
| 41 | + |
| 42 | +SELECT injection_points_run('TestInjectionError'); -- error |
| 43 | +ERROR: error triggered for injection point TestInjectionError |
| 44 | +-- Re-load cache and run again. |
| 45 | +\c |
| 46 | +SELECT injection_points_run('TestInjectionLog2'); -- notice |
| 47 | +NOTICE: notice triggered for injection point TestInjectionLog2 |
| 48 | + injection_points_run |
| 49 | +---------------------- |
| 50 | + |
| 51 | +(1 row) |
| 52 | + |
| 53 | +SELECT injection_points_run('TestInjectionLog'); -- notice |
| 54 | +NOTICE: notice triggered for injection point TestInjectionLog |
| 55 | + injection_points_run |
| 56 | +---------------------- |
| 57 | + |
| 58 | +(1 row) |
| 59 | + |
| 60 | +SELECT injection_points_run('TestInjectionError'); -- error |
| 61 | +ERROR: error triggered for injection point TestInjectionError |
| 62 | +-- Remove one entry and check the remaining entries. |
| 63 | +SELECT injection_points_detach('TestInjectionError'); -- ok |
| 64 | + injection_points_detach |
| 65 | +------------------------- |
| 66 | + |
| 67 | +(1 row) |
| 68 | + |
| 69 | +SELECT injection_points_run('TestInjectionLog'); -- notice |
| 70 | +NOTICE: notice triggered for injection point TestInjectionLog |
| 71 | + injection_points_run |
| 72 | +---------------------- |
| 73 | + |
| 74 | +(1 row) |
| 75 | + |
| 76 | +SELECT injection_points_run('TestInjectionError'); -- nothing |
| 77 | + injection_points_run |
| 78 | +---------------------- |
| 79 | + |
| 80 | +(1 row) |
| 81 | + |
| 82 | +-- More entries removed, letting TestInjectionLog2 to check the same |
| 83 | +-- callback used in more than one point. |
| 84 | +SELECT injection_points_detach('TestInjectionLog'); -- ok |
| 85 | + injection_points_detach |
| 86 | +------------------------- |
| 87 | + |
| 88 | +(1 row) |
| 89 | + |
| 90 | +SELECT injection_points_run('TestInjectionLog'); -- nothing |
| 91 | + injection_points_run |
| 92 | +---------------------- |
| 93 | + |
| 94 | +(1 row) |
| 95 | + |
| 96 | +SELECT injection_points_run('TestInjectionError'); -- nothing |
| 97 | + injection_points_run |
| 98 | +---------------------- |
| 99 | + |
| 100 | +(1 row) |
| 101 | + |
| 102 | +SELECT injection_points_run('TestInjectionLog2'); -- notice |
| 103 | +NOTICE: notice triggered for injection point TestInjectionLog2 |
| 104 | + injection_points_run |
| 105 | +---------------------- |
| 106 | + |
| 107 | +(1 row) |
| 108 | + |
| 109 | +SELECT injection_points_detach('TestInjectionLog'); -- fails |
| 110 | +ERROR: injection point "TestInjectionLog" not found |
| 111 | +SELECT injection_points_run('TestInjectionLog2'); -- notice |
| 112 | +NOTICE: notice triggered for injection point TestInjectionLog2 |
| 113 | + injection_points_run |
| 114 | +---------------------- |
| 115 | + |
| 116 | +(1 row) |
| 117 | + |
| 118 | +DROP EXTENSION injection_points; |
0 commit comments