forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit0a5f06b
committed
Fix a few issues with REINDEX grammar
This addresses a couple of bugs in the REINDEX grammar, introduced by83011ce:- A name was never specified for DATABASE/SYSTEM, even if the queryincluded one. This caused such REINDEX queries to always work with anyobject name, but we should complain if the object name specified doesnot match the name of the database we are connected to. A test is addedfor this case in the main regression test suite, provided by Álvaro.- REINDEX SYSTEM CONCURRENTLY [name] was getting rejected in theparser. Concurrent rebuilds are not supported for catalogs but theerror provided at execution time is more helpful for the user, andallowing this flavor results in a simplification of the parsing logic.- REINDEX DATABASE CONCURRENTLY was rebuilding the index in anon-concurrent way, as the option was not being appended correctly inthe list of DefElems in ReindexStmt (REINDEX (CONCURRENTLY) DATABASE wasworking fine. A test is added in the TAP tests of reindexdb for thiscase, where we already have a REINDEX DATABASE CONCURRENTLY queryrunning on a small-ish instance. This relies on the work done in2cbc3c1 for SYSTEM, but here we check if the OIDs of the index relationsmatch or not after the concurrent rebuild. Note that in order to getthis part to work, I had to tweak the tests so as the index OID andnames are saved separately. This change not affect the reliability orof the coverage of the existing tests.While on it, I have implemented a tweak in the grammar to reduce theparsing by one branch, simplifying things even more.Author: Michael Paquier, Álvaro HerreraDiscussion:https://postgr.es/m/YttqI6O64wDxGn0K@paquier.xyz1 parent7c34555 commit0a5f06b
File tree
5 files changed
+49
-36
lines changed- doc/src/sgml/ref
- src
- backend/parser
- bin/scripts/t
- test/regress
- expected
- sql
5 files changed
+49
-36
lines changedLines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
22 | 22 |
| |
23 | 23 |
| |
24 | 24 |
| |
25 |
| - | |
26 |
| - | |
| 25 | + | |
27 | 26 |
| |
28 | 27 |
| |
29 | 28 |
| |
|
Lines changed: 17 additions & 19 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
564 | 564 |
| |
565 | 565 |
| |
566 | 566 |
| |
567 |
| - | |
| 567 | + | |
568 | 568 |
| |
569 | 569 |
| |
570 | 570 |
| |
| |||
9092 | 9092 |
| |
9093 | 9093 |
| |
9094 | 9094 |
| |
9095 |
| - | |
9096 |
| - | |
9097 |
| - | |
| 9095 | + | |
| 9096 | + | |
9098 | 9097 |
| |
9099 | 9098 |
| |
9100 | 9099 |
| |
9101 |
| - | |
| 9100 | + | |
9102 | 9101 |
| |
9103 | 9102 |
| |
9104 | 9103 |
| |
| |||
9116 | 9115 |
| |
9117 | 9116 |
| |
9118 | 9117 |
| |
9119 |
| - | |
9120 | 9118 |
| |
| 9119 | + | |
9121 | 9120 |
| |
9122 | 9121 |
| |
9123 | 9122 |
| |
9124 | 9123 |
| |
9125 | 9124 |
| |
9126 | 9125 |
| |
9127 |
| - | |
9128 |
| - | |
9129 |
| - | |
9130 |
| - | |
9131 |
| - | |
9132 |
| - | |
9133 |
| - | |
9134 |
| - | |
9135 |
| - | |
9136 |
| - | |
| 9126 | + | |
9137 | 9127 |
| |
9138 | 9128 |
| |
9139 |
| - | |
9140 |
| - | |
| 9129 | + | |
| 9130 | + | |
9141 | 9131 |
| |
| 9132 | + | |
9142 | 9133 |
| |
| 9134 | + | |
| 9135 | + | |
| 9136 | + | |
9143 | 9137 |
| |
9144 | 9138 |
| |
9145 | 9139 |
| |
9146 |
| - | |
| 9140 | + | |
9147 | 9141 |
| |
9148 | 9142 |
| |
9149 | 9143 |
| |
| 9144 | + | |
| 9145 | + | |
| 9146 | + | |
| 9147 | + | |
9150 | 9148 |
| |
9151 | 9149 |
| |
9152 | 9150 |
| |
|
Lines changed: 25 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
40 | 40 |
| |
41 | 41 |
| |
42 | 42 |
| |
43 |
| - | |
| 43 | + | |
44 | 44 |
| |
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
48 |
| - | |
| 48 | + | |
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
54 | 54 |
| |
55 | 55 |
| |
56 |
| - | |
| 56 | + | |
57 | 57 |
| |
58 | 58 |
| |
59 | 59 |
| |
| |||
69 | 69 |
| |
70 | 70 |
| |
71 | 71 |
| |
| 72 | + | |
| 73 | + | |
72 | 74 |
| |
73 | 75 |
| |
74 | 76 |
| |
| |||
83 | 85 |
| |
84 | 86 |
| |
85 | 87 |
| |
86 |
| - | |
87 |
| - | |
88 |
| - | |
89 |
| - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
90 | 92 |
| |
91 | 93 |
| |
92 | 94 |
| |
| |||
98 | 100 |
| |
99 | 101 |
| |
100 | 102 |
| |
101 |
| - | |
102 |
| - | |
103 |
| - | |
104 |
| - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
105 | 107 |
| |
106 | 108 |
| |
107 | 109 |
| |
| |||
132 | 134 |
| |
133 | 135 |
| |
134 | 136 |
| |
135 |
| - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
136 | 142 |
| |
137 | 143 |
| |
138 | 144 |
| |
139 | 145 |
| |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
140 | 153 |
| |
141 | 154 |
| |
142 | 155 |
| |
|
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2521 | 2521 |
| |
2522 | 2522 |
| |
2523 | 2523 |
| |
2524 |
| - | |
2525 |
| - | |
2526 |
| - | |
| 2524 | + | |
2527 | 2525 |
| |
2528 | 2526 |
| |
2529 | 2527 |
| |
2530 | 2528 |
| |
2531 | 2529 |
| |
2532 | 2530 |
| |
2533 | 2531 |
| |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
2534 | 2535 |
| |
2535 | 2536 |
| |
2536 | 2537 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1076 | 1076 |
| |
1077 | 1077 |
| |
1078 | 1078 |
| |
| 1079 | + | |
| 1080 | + | |
1079 | 1081 |
| |
1080 | 1082 |
| |
1081 | 1083 |
| |
|
0 commit comments
Comments
(0)