forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita0b012a
committed
Rearrange ALTER TABLE syntax processing as per my recent proposal: the
grammar allows ALTER TABLE/INDEX/SEQUENCE/VIEW interchangeably for allsubforms of those commands, and then we sort out what's really legalat execution time. This allows the ALTER SEQUENCE/VIEW reference pagesto fully document all the ALTER forms available for sequences and viewsrespectively, and eliminates a longstanding cause of confusion for users.The net effect is that the following forms are allowed that weren't before:ALTER SEQUENCE OWNER TOALTER VIEW ALTER COLUMN SET/DROP DEFAULTALTER VIEW OWNER TOALTER VIEW SET SCHEMA(There's no actual functionality gain here, but formerly you had to sayALTER TABLE instead.)Interestingly, the grammar tables actually get smaller, probably becausethere are fewer special cases to keep track of.I did not disallow using ALTER TABLE for these operations. Perhaps weshould, but there's a backwards-compatibility issue if we do; in factit would break existing pg_dump scripts. I did however tighten upALTER SEQUENCE and ALTER VIEW to reject non-sequences and non-viewsin the new cases as well as a couple of cases where they didn't before.The patch doesn't change pg_dump to use the new syntaxes, either.1 parentbd2ef87 commita0b012a
File tree
7 files changed
+235
-81
lines changed- doc/src/sgml/ref
- src
- backend
- commands
- parser
- tcop
- include/commands
7 files changed
+235
-81
lines changedLines changed: 23 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| 33 | + | |
33 | 34 |
| |
34 | 35 |
| |
35 | 36 |
| |
| |||
48 | 49 |
| |
49 | 50 |
| |
50 | 51 |
| |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
51 | 57 |
| |
52 | 58 |
| |
53 | 59 |
| |
| |||
205 | 211 |
| |
206 | 212 |
| |
207 | 213 |
| |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
208 | 223 |
| |
209 | 224 |
| |
210 | 225 |
| |
| |||
233 | 248 |
| |
234 | 249 |
| |
235 | 250 |
| |
236 |
| - | |
237 |
| - | |
238 |
| - | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
239 | 254 |
| |
240 | 255 |
| |
241 | 256 |
| |
| |||
255 | 270 |
| |
256 | 271 |
| |
257 | 272 |
| |
258 |
| - | |
259 |
| - | |
260 |
| - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
261 | 276 |
| |
262 | 277 |
| |
263 | 278 |
| |
| |||
278 | 293 |
| |
279 | 294 |
| |
280 | 295 |
| |
281 |
| - | |
| 296 | + | |
282 | 297 |
| |
283 | 298 |
| |
284 | 299 |
| |
|
Lines changed: 56 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 |
| - | |
| 2 | + | |
3 | 3 |
| |
4 | 4 |
| |
5 | 5 |
| |
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
23 |
| - | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
24 | 28 |
| |
25 | 29 |
| |
26 | 30 |
| |
27 | 31 |
| |
28 | 32 |
| |
29 | 33 |
| |
30 | 34 |
| |
31 |
| - | |
32 |
| - | |
33 |
| - | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
34 | 49 |
| |
35 | 50 |
| |
36 | 51 |
| |
| |||
48 | 63 |
| |
49 | 64 |
| |
50 | 65 |
| |
51 |
| - | |
| 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 | + | |
52 | 98 |
| |
53 | 99 |
| |
54 |
| - | |
| 100 | + | |
55 | 101 |
| |
56 | 102 |
| |
57 | 103 |
| |
| |||
62 | 108 |
| |
63 | 109 |
| |
64 | 110 |
| |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 |
| - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
70 | 114 |
| |
71 | 115 |
| |
72 | 116 |
| |
|
Lines changed: 4 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
185 | 185 |
| |
186 | 186 |
| |
187 | 187 |
| |
| 188 | + | |
188 | 189 |
| |
189 |
| - | |
| 190 | + | |
| 191 | + | |
190 | 192 |
| |
191 | 193 |
| |
192 | 194 |
| |
|
Lines changed: 71 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
| 11 | + | |
12 | 12 |
| |
13 | 13 |
| |
14 | 14 |
| |
| |||
2175 | 2175 |
| |
2176 | 2176 |
| |
2177 | 2177 |
| |
| 2178 | + | |
| 2179 | + | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
| 2184 | + | |
| 2185 | + | |
| 2186 | + | |
| 2187 | + | |
| 2188 | + | |
| 2189 | + | |
| 2190 | + | |
| 2191 | + | |
| 2192 | + | |
| 2193 | + | |
| 2194 | + | |
| 2195 | + | |
| 2196 | + | |
| 2197 | + | |
| 2198 | + | |
| 2199 | + | |
| 2200 | + | |
| 2201 | + | |
| 2202 | + | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
| 2208 | + | |
| 2209 | + | |
| 2210 | + | |
| 2211 | + | |
| 2212 | + | |
| 2213 | + | |
| 2214 | + | |
| 2215 | + | |
2178 | 2216 |
| |
2179 | 2217 |
| |
2180 | 2218 |
| |
| |||
7191 | 7229 |
| |
7192 | 7230 |
| |
7193 | 7231 |
| |
7194 |
| - | |
| 7232 | + | |
| 7233 | + | |
7195 | 7234 |
| |
7196 | 7235 |
| |
7197 | 7236 |
| |
| |||
7204 | 7243 |
| |
7205 | 7244 |
| |
7206 | 7245 |
| |
| 7246 | + | |
| 7247 | + | |
| 7248 | + | |
| 7249 | + | |
| 7250 | + | |
| 7251 | + | |
| 7252 | + | |
| 7253 | + | |
| 7254 | + | |
| 7255 | + | |
| 7256 | + | |
| 7257 | + | |
| 7258 | + | |
| 7259 | + | |
| 7260 | + | |
| 7261 | + | |
| 7262 | + | |
| 7263 | + | |
| 7264 | + | |
| 7265 | + | |
| 7266 | + | |
| 7267 | + | |
| 7268 | + | |
| 7269 | + | |
| 7270 | + | |
| 7271 | + | |
| 7272 | + | |
| 7273 | + | |
| 7274 | + | |
| 7275 | + | |
7207 | 7276 |
| |
7208 | 7277 |
| |
7209 | 7278 |
| |
|
0 commit comments
Comments
(0)