blob: dfd0ce70945aaf854452ae3200dff233e8b4c930 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
|
# ALTER TABLE - Add and Validate constraint with concurrent writes
#
# VALIDATE allows a minimum of ShareUpdateExclusiveLock
# so we mix reads with it to see what works or waits
setup
{
CREATE TABLE a (i int PRIMARY KEY);
CREATE TABLE b (a_id int);
INSERT INTO a VALUES (0), (1), (2), (3);
INSERT INTO b SELECT generate_series(1,1000) % 4;
}
teardown
{
DROP TABLE a, b;
}
session s1
step s1 { BEGIN; }
step at1 { ALTER TABLE b ADD CONSTRAINT bfk FOREIGN KEY (a_id) REFERENCES a (i) NOT VALID; }
step sc1 { COMMIT; }
step s2 { BEGIN; }
step at2 { ALTER TABLE b VALIDATE CONSTRAINT bfk; }
step sc2 { COMMIT; }
session s2
setup { BEGIN; }
step rx1 { SELECT * FROM b WHERE a_id = 1 LIMIT 1; }
step wx { INSERT INTO b VALUES (0); }
step rx3 { SELECT * FROM b WHERE a_id = 3 LIMIT 3; }
step c2 { COMMIT; }
permutation s1 at1 sc1 s2 at2 sc2 rx1 wx rx3 c2
permutation s1 at1 sc1 s2 at2 rx1 sc2 wx rx3 c2
permutation s1 at1 sc1 s2 at2 rx1 wx sc2 rx3 c2
permutation s1 at1 sc1 s2 at2 rx1 wx rx3 sc2 c2
permutation s1 at1 sc1 s2 at2 rx1 wx rx3 c2 sc2
permutation s1 at1 sc1 s2 rx1 at2 sc2 wx rx3 c2
permutation s1 at1 sc1 s2 rx1 at2 wx sc2 rx3 c2
permutation s1 at1 sc1 s2 rx1 at2 wx rx3 sc2 c2
permutation s1 at1 sc1 s2 rx1 at2 wx rx3 c2 sc2
permutation s1 at1 sc1 s2 rx1 wx at2 sc2 rx3 c2
permutation s1 at1 sc1 s2 rx1 wx at2 rx3 sc2 c2
permutation s1 at1 sc1 s2 rx1 wx at2 rx3 c2 sc2
permutation s1 at1 sc1 s2 rx1 wx rx3 at2 sc2 c2
permutation s1 at1 sc1 s2 rx1 wx rx3 at2 c2 sc2
permutation s1 at1 sc1 s2 rx1 wx rx3 c2 at2 sc2
permutation s1 at1 sc1 rx1 s2 at2 sc2 wx rx3 c2
permutation s1 at1 sc1 rx1 s2 at2 wx sc2 rx3 c2
permutation s1 at1 sc1 rx1 s2 at2 wx rx3 sc2 c2
permutation s1 at1 sc1 rx1 s2 at2 wx rx3 c2 sc2
permutation s1 at1 sc1 rx1 s2 wx at2 sc2 rx3 c2
permutation s1 at1 sc1 rx1 s2 wx at2 rx3 sc2 c2
permutation s1 at1 sc1 rx1 s2 wx at2 rx3 c2 sc2
permutation s1 at1 sc1 rx1 s2 wx rx3 at2 sc2 c2
permutation s1 at1 sc1 rx1 s2 wx rx3 at2 c2 sc2
permutation s1 at1 sc1 rx1 s2 wx rx3 c2 at2 sc2
permutation s1 at1 sc1 rx1 wx s2 at2 sc2 rx3 c2
permutation s1 at1 sc1 rx1 wx s2 at2 rx3 sc2 c2
permutation s1 at1 sc1 rx1 wx s2 at2 rx3 c2 sc2
permutation s1 at1 sc1 rx1 wx s2 rx3 at2 sc2 c2
permutation s1 at1 sc1 rx1 wx s2 rx3 at2 c2 sc2
permutation s1 at1 sc1 rx1 wx s2 rx3 c2 at2 sc2
permutation s1 at1 sc1 rx1 wx rx3 s2 at2 sc2 c2
permutation s1 at1 sc1 rx1 wx rx3 s2 at2 c2 sc2
permutation s1 at1 sc1 rx1 wx rx3 s2 c2 at2 sc2
permutation s1 at1 sc1 rx1 wx rx3 c2 s2 at2 sc2
permutation s1 at1 rx1 sc1 s2 at2 sc2 wx rx3 c2
permutation s1 at1 rx1 sc1 s2 at2 wx sc2 rx3 c2
permutation s1 at1 rx1 sc1 s2 at2 wx rx3 sc2 c2
permutation s1 at1 rx1 sc1 s2 at2 wx rx3 c2 sc2
permutation s1 at1 rx1 sc1 s2 wx at2 sc2 rx3 c2
permutation s1 at1 rx1 sc1 s2 wx at2 rx3 sc2 c2
permutation s1 at1 rx1 sc1 s2 wx at2 rx3 c2 sc2
permutation s1 at1 rx1 sc1 s2 wx rx3 at2 sc2 c2
permutation s1 at1 rx1 sc1 s2 wx rx3 at2 c2 sc2
permutation s1 at1 rx1 sc1 s2 wx rx3 c2 at2 sc2
permutation s1 at1 rx1 sc1 wx s2 at2 sc2 rx3 c2
permutation s1 at1 rx1 sc1 wx s2 at2 rx3 sc2 c2
permutation s1 at1 rx1 sc1 wx s2 at2 rx3 c2 sc2
permutation s1 at1 rx1 sc1 wx s2 rx3 at2 sc2 c2
permutation s1 at1 rx1 sc1 wx s2 rx3 at2 c2 sc2
permutation s1 at1 rx1 sc1 wx s2 rx3 c2 at2 sc2
permutation s1 at1 rx1 sc1 wx rx3 s2 at2 sc2 c2
permutation s1 at1 rx1 sc1 wx rx3 s2 at2 c2 sc2
permutation s1 at1 rx1 sc1 wx rx3 s2 c2 at2 sc2
permutation s1 at1 rx1 sc1 wx rx3 c2 s2 at2 sc2
permutation s1 at1 rx1 wx sc1 s2 at2 sc2 rx3 c2
permutation s1 at1 rx1 wx sc1 s2 at2 rx3 sc2 c2
permutation s1 at1 rx1 wx sc1 s2 at2 rx3 c2 sc2
permutation s1 at1 rx1 wx sc1 s2 rx3 at2 sc2 c2
permutation s1 at1 rx1 wx sc1 s2 rx3 at2 c2 sc2
permutation s1 at1 rx1 wx sc1 s2 rx3 c2 at2 sc2
permutation s1 at1 rx1 wx sc1 rx3 s2 at2 sc2 c2
permutation s1 at1 rx1 wx sc1 rx3 s2 at2 c2 sc2
permutation s1 at1 rx1 wx sc1 rx3 s2 c2 at2 sc2
permutation s1 at1 rx1 wx sc1 rx3 c2 s2 at2 sc2
permutation s1 rx1 at1 sc1 s2 at2 sc2 wx rx3 c2
permutation s1 rx1 at1 sc1 s2 at2 wx sc2 rx3 c2
permutation s1 rx1 at1 sc1 s2 at2 wx rx3 sc2 c2
permutation s1 rx1 at1 sc1 s2 at2 wx rx3 c2 sc2
permutation s1 rx1 at1 sc1 s2 wx at2 sc2 rx3 c2
permutation s1 rx1 at1 sc1 s2 wx at2 rx3 sc2 c2
permutation s1 rx1 at1 sc1 s2 wx at2 rx3 c2 sc2
permutation s1 rx1 at1 sc1 s2 wx rx3 at2 sc2 c2
permutation s1 rx1 at1 sc1 s2 wx rx3 at2 c2 sc2
permutation s1 rx1 at1 sc1 s2 wx rx3 c2 at2 sc2
permutation s1 rx1 at1 sc1 wx s2 at2 sc2 rx3 c2
permutation s1 rx1 at1 sc1 wx s2 at2 rx3 sc2 c2
permutation s1 rx1 at1 sc1 wx s2 at2 rx3 c2 sc2
permutation s1 rx1 at1 sc1 wx s2 rx3 at2 sc2 c2
permutation s1 rx1 at1 sc1 wx s2 rx3 at2 c2 sc2
permutation s1 rx1 at1 sc1 wx s2 rx3 c2 at2 sc2
permutation s1 rx1 at1 sc1 wx rx3 s2 at2 sc2 c2
permutation s1 rx1 at1 sc1 wx rx3 s2 at2 c2 sc2
permutation s1 rx1 at1 sc1 wx rx3 s2 c2 at2 sc2
permutation s1 rx1 at1 sc1 wx rx3 c2 s2 at2 sc2
permutation s1 rx1 at1 wx sc1 s2 at2 sc2 rx3 c2
permutation s1 rx1 at1 wx sc1 s2 at2 rx3 sc2 c2
permutation s1 rx1 at1 wx sc1 s2 at2 rx3 c2 sc2
permutation s1 rx1 at1 wx sc1 s2 rx3 at2 sc2 c2
permutation s1 rx1 at1 wx sc1 s2 rx3 at2 c2 sc2
permutation s1 rx1 at1 wx sc1 s2 rx3 c2 at2 sc2
permutation s1 rx1 at1 wx sc1 rx3 s2 at2 sc2 c2
permutation s1 rx1 at1 wx sc1 rx3 s2 at2 c2 sc2
permutation s1 rx1 at1 wx sc1 rx3 s2 c2 at2 sc2
permutation s1 rx1 at1 wx sc1 rx3 c2 s2 at2 sc2
permutation s1 rx1 wx at1 rx3 c2 sc1 s2 at2 sc2
permutation s1 rx1 wx rx3 at1 c2 sc1 s2 at2 sc2
permutation s1 rx1 wx rx3 c2 at1 sc1 s2 at2 sc2
permutation rx1 s1 at1 sc1 s2 at2 sc2 wx rx3 c2
permutation rx1 s1 at1 sc1 s2 at2 wx sc2 rx3 c2
permutation rx1 s1 at1 sc1 s2 at2 wx rx3 sc2 c2
permutation rx1 s1 at1 sc1 s2 at2 wx rx3 c2 sc2
permutation rx1 s1 at1 sc1 s2 wx at2 sc2 rx3 c2
permutation rx1 s1 at1 sc1 s2 wx at2 rx3 sc2 c2
permutation rx1 s1 at1 sc1 s2 wx at2 rx3 c2 sc2
permutation rx1 s1 at1 sc1 s2 wx rx3 at2 sc2 c2
permutation rx1 s1 at1 sc1 s2 wx rx3 at2 c2 sc2
permutation rx1 s1 at1 sc1 s2 wx rx3 c2 at2 sc2
permutation rx1 s1 at1 sc1 wx s2 at2 sc2 rx3 c2
permutation rx1 s1 at1 sc1 wx s2 at2 rx3 sc2 c2
permutation rx1 s1 at1 sc1 wx s2 at2 rx3 c2 sc2
permutation rx1 s1 at1 sc1 wx s2 rx3 at2 sc2 c2
permutation rx1 s1 at1 sc1 wx s2 rx3 at2 c2 sc2
permutation rx1 s1 at1 sc1 wx s2 rx3 c2 at2 sc2
permutation rx1 s1 at1 sc1 wx rx3 s2 at2 sc2 c2
permutation rx1 s1 at1 sc1 wx rx3 s2 at2 c2 sc2
permutation rx1 s1 at1 sc1 wx rx3 s2 c2 at2 sc2
permutation rx1 s1 at1 sc1 wx rx3 c2 s2 at2 sc2
permutation rx1 s1 at1 wx sc1 s2 at2 sc2 rx3 c2
permutation rx1 s1 at1 wx sc1 s2 at2 rx3 sc2 c2
permutation rx1 s1 at1 wx sc1 s2 at2 rx3 c2 sc2
permutation rx1 s1 at1 wx sc1 s2 rx3 at2 sc2 c2
permutation rx1 s1 at1 wx sc1 s2 rx3 at2 c2 sc2
permutation rx1 s1 at1 wx sc1 s2 rx3 c2 at2 sc2
permutation rx1 s1 at1 wx sc1 rx3 s2 at2 sc2 c2
permutation rx1 s1 at1 wx sc1 rx3 s2 at2 c2 sc2
permutation rx1 s1 at1 wx sc1 rx3 s2 c2 at2 sc2
permutation rx1 s1 at1 wx sc1 rx3 c2 s2 at2 sc2
permutation rx1 s1 wx at1 rx3 c2 sc1 s2 at2 sc2
permutation rx1 s1 wx rx3 at1 c2 sc1 s2 at2 sc2
permutation rx1 s1 wx rx3 c2 at1 sc1 s2 at2 sc2
permutation rx1 wx s1 at1 rx3 c2 sc1 s2 at2 sc2
permutation rx1 wx s1 rx3 at1 c2 sc1 s2 at2 sc2
permutation rx1 wx s1 rx3 c2 at1 sc1 s2 at2 sc2
permutation rx1 wx rx3 s1 at1 c2 sc1 s2 at2 sc2
permutation rx1 wx rx3 s1 c2 at1 sc1 s2 at2 sc2
permutation rx1 wx rx3 c2 s1 at1 sc1 s2 at2 sc2
|