Commit 7b8b8a4
committed
Improve representation of PlanRowMark.
This patch fixes two inadequacies of the PlanRowMark representation.
First, that the original LockingClauseStrength isn't stored (and cannot be
inferred for foreign tables, which always get ROW_MARK_COPY). Since some
PlanRowMarks are created out of whole cloth and don't actually have an
ancestral RowMarkClause, this requires adding a dummy LCS_NONE value to
enum LockingClauseStrength, which is fairly annoying but the alternatives
seem worse. This fix allows getting rid of the use of get_parse_rowmark()
in FDWs (as per the discussion around commits 462bd95 and
8ec8760), and it simplifies some things elsewhere.
Second, that the representation assumed that all child tables in an
inheritance hierarchy would use the same RowMarkType. That's true today
but will soon not be true. We add an "allMarkTypes" field that identifies
the union of mark types used in all a parent table's children, and use
that where appropriate (currently, only in preprocess_targetlist()).
In passing fix a couple of minor infelicities left over from the SKIP
LOCKED patch, notably that _outPlanRowMark still thought waitPolicy
is a bool.
Catversion bump is required because the numeric values of enum
LockingClauseStrength can appear in on-disk rules.
Extracted from a much larger patch to support foreign table inheritance;
it seemed worth breaking this out, since it's a separable concern.
Shigeru Hanada and Etsuro Fujita, somewhat modified by me1 parent 9fac5fd commit 7b8b8a4
File tree
14 files changed
+108
-85
lines changed- contrib/postgres_fdw
- src
- backend
- nodes
- optimizer
- plan
- prep
- parser
- tcop
- utils/adt
- include
- catalog
- nodes
- parser
14 files changed
+108
-85
lines changedLines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
822 | 822 |
| |
823 | 823 |
| |
824 | 824 |
| |
825 |
| - | |
| 825 | + | |
826 | 826 |
| |
827 | 827 |
| |
828 | 828 |
| |
829 | 829 |
| |
830 | 830 |
| |
831 |
| - | |
| 831 | + | |
| 832 | + | |
832 | 833 |
| |
833 | 834 |
| |
834 | 835 |
| |
| |||
837 | 838 |
| |
838 | 839 |
| |
839 | 840 |
| |
| 841 | + | |
| 842 | + | |
| 843 | + | |
840 | 844 |
| |
841 | 845 |
| |
842 | 846 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
991 | 991 |
| |
992 | 992 |
| |
993 | 993 |
| |
| 994 | + | |
| 995 | + | |
994 | 996 |
| |
995 | 997 |
| |
996 | 998 |
| |
| |||
2510 | 2512 |
| |
2511 | 2513 |
| |
2512 | 2514 |
| |
2513 |
| - | |
| 2515 | + | |
2514 | 2516 |
| |
2515 | 2517 |
| |
2516 | 2518 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
852 | 852 |
| |
853 | 853 |
| |
854 | 854 |
| |
855 |
| - | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
856 | 858 |
| |
857 | 859 |
| |
858 | 860 |
| |
|
Lines changed: 31 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2219 | 2219 |
| |
2220 | 2220 |
| |
2221 | 2221 |
| |
2222 |
| - | |
2223 |
| - | |
2224 |
| - | |
2225 |
| - | |
2226 |
| - | |
2227 |
| - | |
2228 |
| - | |
2229 |
| - | |
2230 |
| - | |
2231 | 2222 |
| |
2232 | 2223 |
| |
2233 | 2224 |
| |
2234 | 2225 |
| |
2235 | 2226 |
| |
2236 |
| - | |
| 2227 | + | |
2237 | 2228 |
| |
2238 |
| - | |
2239 |
| - | |
2240 |
| - | |
2241 |
| - | |
2242 |
| - | |
2243 |
| - | |
2244 |
| - | |
2245 |
| - | |
2246 |
| - | |
2247 |
| - | |
2248 |
| - | |
2249 |
| - | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
| 2235 | + | |
| 2236 | + | |
| 2237 | + | |
| 2238 | + | |
| 2239 | + | |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
2250 | 2255 |
| |
| 2256 | + | |
| 2257 | + | |
2251 | 2258 |
| |
2252 | 2259 |
| |
2253 | 2260 |
| |
| |||
2276 | 2283 |
| |
2277 | 2284 |
| |
2278 | 2285 |
| |
| 2286 | + | |
| 2287 | + | |
2279 | 2288 |
| |
2280 | 2289 |
| |
2281 | 2290 |
| |
|
Lines changed: 7 additions & 26 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
73 | 73 |
| |
74 | 74 |
| |
75 | 75 |
| |
76 |
| - | |
77 |
| - | |
| 76 | + | |
| 77 | + | |
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
| |||
241 | 241 |
| |
242 | 242 |
| |
243 | 243 |
| |
244 |
| - | |
245 |
| - | |
246 |
| - | |
247 |
| - | |
248 |
| - | |
249 |
| - | |
250 |
| - | |
251 |
| - | |
252 |
| - | |
253 |
| - | |
254 |
| - | |
255 |
| - | |
256 |
| - | |
257 |
| - | |
258 |
| - | |
259 |
| - | |
260 |
| - | |
261 |
| - | |
262 |
| - | |
263 |
| - | |
264 |
| - | |
265 |
| - | |
266 |
| - | |
267 |
| - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
268 | 248 |
| |
269 | 249 |
| |
270 | 250 |
| |
| |||
276 | 256 |
| |
277 | 257 |
| |
278 | 258 |
| |
| 259 | + | |
279 | 260 |
| |
280 | 261 |
| |
281 | 262 |
| |
|
Lines changed: 4 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
95 |
| - | |
| 95 | + | |
96 | 96 |
| |
97 |
| - | |
| 97 | + | |
98 | 98 |
| |
99 | 99 |
| |
100 | 100 |
| |
| |||
125 | 125 |
| |
126 | 126 |
| |
127 | 127 |
| |
128 |
| - | |
| 128 | + | |
129 | 129 |
| |
130 |
| - | |
| 130 | + | |
131 | 131 |
| |
132 | 132 |
| |
133 | 133 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1389 | 1389 |
| |
1390 | 1390 |
| |
1391 | 1391 |
| |
| 1392 | + | |
| 1393 | + | |
1392 | 1394 |
| |
1393 | 1395 |
| |
1394 | 1396 |
| |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
1395 | 1400 |
| |
1396 | 1401 |
| |
1397 | 1402 |
| |
|
Lines changed: 24 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2254 | 2254 |
| |
2255 | 2255 |
| |
2256 | 2256 |
| |
2257 |
| - | |
| 2257 | + | |
| 2258 | + | |
| 2259 | + | |
| 2260 | + | |
| 2261 | + | |
2258 | 2262 |
| |
2259 | 2263 |
| |
2260 | 2264 |
| |
2261 | 2265 |
| |
| 2266 | + | |
| 2267 | + | |
| 2268 | + | |
2262 | 2269 |
| |
2263 | 2270 |
| |
2264 | 2271 |
| |
| |||
2279 | 2286 |
| |
2280 | 2287 |
| |
2281 | 2288 |
| |
| 2289 | + | |
| 2290 | + | |
2282 | 2291 |
| |
2283 | 2292 |
| |
2284 | 2293 |
| |
| |||
2498 | 2507 |
| |
2499 | 2508 |
| |
2500 | 2509 |
| |
| 2510 | + | |
| 2511 | + | |
2501 | 2512 |
| |
2502 | 2513 |
| |
2503 | 2514 |
| |
| |||
2506 | 2517 |
| |
2507 | 2518 |
| |
2508 | 2519 |
| |
2509 |
| - | |
2510 |
| - | |
2511 |
| - | |
2512 |
| - | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
2513 | 2524 |
| |
2514 |
| - | |
2515 |
| - | |
2516 |
| - | |
2517 |
| - | |
2518 |
| - | |
| 2525 | + | |
| 2526 | + | |
| 2527 | + | |
| 2528 | + | |
| 2529 | + | |
2519 | 2530 |
| |
2520 | 2531 |
| |
2521 |
| - | |
2522 |
| - | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
2523 | 2535 |
| |
2524 | 2536 |
| |
2525 | 2537 |
| |
|
Lines changed: 9 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2395 | 2395 |
| |
2396 | 2396 |
| |
2397 | 2397 |
| |
2398 |
| - | |
| 2398 | + | |
2399 | 2399 |
| |
2400 |
| - | |
2401 |
| - | |
2402 |
| - | |
2403 |
| - | |
2404 |
| - | |
| 2400 | + | |
| 2401 | + | |
2405 | 2402 |
| |
2406 |
| - | |
| 2403 | + | |
2407 | 2404 |
| |
2408 | 2405 |
| |
2409 |
| - | |
2410 |
| - | |
| 2406 | + | |
| 2407 | + | |
2411 | 2408 |
| |
2412 |
| - | |
2413 |
| - | |
2414 |
| - | |
| 2409 | + | |
| 2410 | + | |
2415 | 2411 |
| |
2416 | 2412 |
| |
2417 |
| - | |
| 2413 | + | |
2418 | 2414 |
| |
2419 | 2415 |
| |
2420 | 2416 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4453 | 4453 |
| |
4454 | 4454 |
| |
4455 | 4455 |
| |
| 4456 | + | |
| 4457 | + | |
| 4458 | + | |
| 4459 | + | |
| 4460 | + | |
4456 | 4461 |
| |
4457 | 4462 |
| |
4458 | 4463 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
|
Lines changed: 8 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
820 | 820 |
| |
821 | 821 |
| |
822 | 822 |
| |
823 |
| - | |
| 823 | + | |
824 | 824 |
| |
825 | 825 |
| |
826 | 826 |
| |
| |||
841 | 841 |
| |
842 | 842 |
| |
843 | 843 |
| |
844 |
| - | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
845 | 847 |
| |
846 | 848 |
| |
847 | 849 |
| |
| |||
851 | 853 |
| |
852 | 854 |
| |
853 | 855 |
| |
| 856 | + | |
| 857 | + | |
854 | 858 |
| |
855 | 859 |
| |
856 | 860 |
| |
| |||
867 | 871 |
| |
868 | 872 |
| |
869 | 873 |
| |
| 874 | + | |
| 875 | + | |
870 | 876 |
| |
871 | 877 |
| |
872 | 878 |
| |
|
0 commit comments