|
| 1 | +-- |
| 2 | +-- OAT checks for ALTER TABLE |
| 3 | +-- |
| 4 | +-- This test script fails if debug_discard_caches is enabled, because cache |
| 5 | +-- flushes cause extra calls of the OAT hook in recomputeNamespacePath, |
| 6 | +-- resulting in more NOTICE messages than are in the expected output. |
| 7 | +SET debug_discard_caches = 0; |
| 8 | +LOAD 'test_oat_hooks'; |
| 9 | +SET test_oat_hooks.audit = true; |
| 10 | +NOTICE: in object_access_hook_str: superuser attempting alter (subId=0x1000, set) [test_oat_hooks.audit] |
| 11 | +NOTICE: in object_access_hook_str: superuser finished alter (subId=0x1000, set) [test_oat_hooks.audit] |
| 12 | +NOTICE: in process utility: superuser finished SET |
| 13 | +CREATE SCHEMA test_oat_schema; |
| 14 | +NOTICE: in process utility: superuser attempting CREATE SCHEMA |
| 15 | +NOTICE: in object access: superuser attempting create (subId=0x0) [explicit] |
| 16 | +NOTICE: in object access: superuser finished create (subId=0x0) [explicit] |
| 17 | +NOTICE: in process utility: superuser finished CREATE SCHEMA |
| 18 | +CREATE TABLE test_oat_schema.test_oat_tab (c1 int, c2 text); |
| 19 | +NOTICE: in process utility: superuser attempting CREATE TABLE |
| 20 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 21 | +LINE 1: CREATE TABLE test_oat_schema.test_oat_tab (c1 int, c2 text); |
| 22 | + ^ |
| 23 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 24 | +LINE 1: CREATE TABLE test_oat_schema.test_oat_tab (c1 int, c2 text); |
| 25 | + ^ |
| 26 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [no report on violation, allowed] |
| 27 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [no report on violation, allowed] |
| 28 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 29 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 30 | +NOTICE: in object access: superuser attempting create (subId=0x0) [explicit] |
| 31 | +NOTICE: in object access: superuser finished create (subId=0x0) [explicit] |
| 32 | +NOTICE: in object access: superuser attempting create (subId=0x0) [explicit] |
| 33 | +NOTICE: in object access: superuser finished create (subId=0x0) [explicit] |
| 34 | +NOTICE: in object access: superuser attempting create (subId=0x0) [explicit] |
| 35 | +NOTICE: in object access: superuser finished create (subId=0x0) [explicit] |
| 36 | +NOTICE: in object access: superuser attempting create (subId=0x0) [internal] |
| 37 | +NOTICE: in object access: superuser finished create (subId=0x0) [internal] |
| 38 | +NOTICE: in object access: superuser attempting create (subId=0x0) [internal] |
| 39 | +NOTICE: in object access: superuser finished create (subId=0x0) [internal] |
| 40 | +NOTICE: in process utility: superuser finished CREATE TABLE |
| 41 | +CREATE RULE test_oat_notify AS |
| 42 | + ON UPDATE TO test_oat_schema.test_oat_tab |
| 43 | + DO ALSO NOTIFY test_oat_tab; |
| 44 | +NOTICE: in process utility: superuser attempting CREATE RULE |
| 45 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 46 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 47 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 48 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 49 | +NOTICE: in object access: superuser attempting create (subId=0x0) [explicit] |
| 50 | +NOTICE: in object access: superuser finished create (subId=0x0) [explicit] |
| 51 | +NOTICE: in process utility: superuser finished CREATE RULE |
| 52 | +CREATE FUNCTION test_oat_schema.test_trigger() |
| 53 | +RETURNS trigger |
| 54 | +LANGUAGE plpgsql |
| 55 | +AS $$ |
| 56 | +BEGIN |
| 57 | + IF TG_OP = 'DELETE' |
| 58 | + THEN |
| 59 | + RETURN OLD; |
| 60 | + ELSE |
| 61 | + RETURN NEW; |
| 62 | + END IF; |
| 63 | +END; $$; |
| 64 | +NOTICE: in process utility: superuser attempting CREATE FUNCTION |
| 65 | +NOTICE: in object access: superuser attempting create (subId=0x0) [explicit] |
| 66 | +NOTICE: in object access: superuser finished create (subId=0x0) [explicit] |
| 67 | +NOTICE: in process utility: superuser finished CREATE FUNCTION |
| 68 | +CREATE TRIGGER test_oat_trigger BEFORE INSERT ON test_oat_schema.test_oat_tab |
| 69 | + FOR EACH STATEMENT EXECUTE FUNCTION test_oat_schema.test_trigger(); |
| 70 | +NOTICE: in process utility: superuser attempting CREATE TRIGGER |
| 71 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 72 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 73 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 74 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 75 | +NOTICE: in object access: superuser attempting create (subId=0x0) [explicit] |
| 76 | +NOTICE: in object access: superuser finished create (subId=0x0) [explicit] |
| 77 | +NOTICE: in process utility: superuser finished CREATE TRIGGER |
| 78 | +-- RLS |
| 79 | +ALTER TABLE test_oat_schema.test_oat_tab ENABLE ROW LEVEL SECURITY; |
| 80 | +NOTICE: in process utility: superuser attempting ALTER TABLE |
| 81 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 82 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 83 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 84 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 85 | +NOTICE: in process utility: superuser finished ALTER TABLE |
| 86 | +ALTER TABLE test_oat_schema.test_oat_tab DISABLE ROW LEVEL SECURITY; |
| 87 | +NOTICE: in process utility: superuser attempting ALTER TABLE |
| 88 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 89 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 90 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 91 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 92 | +NOTICE: in process utility: superuser finished ALTER TABLE |
| 93 | +ALTER TABLE test_oat_schema.test_oat_tab FORCE ROW LEVEL SECURITY; |
| 94 | +NOTICE: in process utility: superuser attempting ALTER TABLE |
| 95 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 96 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 97 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 98 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 99 | +NOTICE: in process utility: superuser finished ALTER TABLE |
| 100 | +ALTER TABLE test_oat_schema.test_oat_tab NO FORCE ROW LEVEL SECURITY; |
| 101 | +NOTICE: in process utility: superuser attempting ALTER TABLE |
| 102 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 103 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 104 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 105 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 106 | +NOTICE: in process utility: superuser finished ALTER TABLE |
| 107 | +-- Rules |
| 108 | +ALTER TABLE test_oat_schema.test_oat_tab DISABLE RULE test_oat_notify; |
| 109 | +NOTICE: in process utility: superuser attempting ALTER TABLE |
| 110 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 111 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 112 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 113 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 114 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 115 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 116 | +NOTICE: in process utility: superuser finished ALTER TABLE |
| 117 | +ALTER TABLE test_oat_schema.test_oat_tab ENABLE RULE test_oat_notify; |
| 118 | +NOTICE: in process utility: superuser attempting ALTER TABLE |
| 119 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 120 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 121 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 122 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 123 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 124 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 125 | +NOTICE: in process utility: superuser finished ALTER TABLE |
| 126 | +-- Triggers |
| 127 | +ALTER TABLE test_oat_schema.test_oat_tab DISABLE TRIGGER test_oat_trigger; |
| 128 | +NOTICE: in process utility: superuser attempting ALTER TABLE |
| 129 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 130 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 131 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 132 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 133 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 134 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 135 | +NOTICE: in process utility: superuser finished ALTER TABLE |
| 136 | +ALTER TABLE test_oat_schema.test_oat_tab ENABLE TRIGGER test_oat_trigger; |
| 137 | +NOTICE: in process utility: superuser attempting ALTER TABLE |
| 138 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 139 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 140 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 141 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 142 | +NOTICE: in object access: superuser attempting alter (subId=0x0) [explicit without auxiliary object] |
| 143 | +NOTICE: in object access: superuser finished alter (subId=0x0) [explicit without auxiliary object] |
| 144 | +NOTICE: in process utility: superuser finished ALTER TABLE |
| 145 | +DROP TABLE test_oat_schema.test_oat_tab; |
| 146 | +NOTICE: in process utility: superuser attempting DROP TABLE |
| 147 | +NOTICE: in object access: superuser attempting namespace search (subId=0x0) [report on violation, allowed] |
| 148 | +NOTICE: in object access: superuser finished namespace search (subId=0x0) [report on violation, allowed] |
| 149 | +NOTICE: in object access: superuser attempting drop (subId=0x0) [] |
| 150 | +NOTICE: in object access: superuser finished drop (subId=0x0) [] |
| 151 | +NOTICE: in object access: superuser attempting drop (subId=0x0) [] |
| 152 | +NOTICE: in object access: superuser finished drop (subId=0x0) [] |
| 153 | +NOTICE: in object access: superuser attempting drop (subId=0x0) [] |
| 154 | +NOTICE: in object access: superuser finished drop (subId=0x0) [] |
| 155 | +NOTICE: in object access: superuser attempting drop (subId=0x0) [] |
| 156 | +NOTICE: in object access: superuser finished drop (subId=0x0) [] |
| 157 | +NOTICE: in object access: superuser attempting drop (subId=0x0) [] |
| 158 | +NOTICE: in object access: superuser finished drop (subId=0x0) [] |
| 159 | +NOTICE: in object access: superuser attempting drop (subId=0x0) [] |
| 160 | +NOTICE: in object access: superuser finished drop (subId=0x0) [] |
| 161 | +NOTICE: in object access: superuser attempting drop (subId=0x0) [] |
| 162 | +NOTICE: in object access: superuser finished drop (subId=0x0) [] |
| 163 | +NOTICE: in process utility: superuser finished DROP TABLE |
0 commit comments