forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit2ea5b06
committed
Add CREATE SEQUENCE AS <data type> clause
This stores a data type, required to be an integer type, with thesequence. The sequences min and max values default to the rangesupported by the type, and they cannot be set to values exceeding thatrange. The internal implementation of the sequence is not affected.Change the serial types to create sequences of the appropriate type.This makes sure that the min and max values of the sequence for a serialcolumn match the range of values supported by the table column. So thesequence can no longer overflow the table column.This also makes monitoring for sequence exhaustion/wraparound easier,which currently requires various contortions to cross-reference thesequences with the table columns they are used with.This commit also effectively reverts the pg_sequence column reorderinginf3b421d, because the new seqtypidcolumn allows us to fill the hole in the struct and create a morenatural overall column ordering.Reviewed-by: Steve Singer <steve@ssinger.info>Reviewed-by: Michael Paquier <michael.paquier@gmail.com>1 parent9401883 commit2ea5b06
File tree
18 files changed
+274
-99
lines changed- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- parser
- bin/pg_dump
- t
- include/catalog
- test
- modules/test_pg_dump/t
- regress
- expected
- sql
18 files changed
+274
-99
lines changedLines changed: 17 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5774 | 5774 |
| |
5775 | 5775 |
| |
5776 | 5776 |
| |
5777 |
| - | |
5778 |
| - | |
| 5777 | + | |
| 5778 | + | |
| 5779 | + | |
5779 | 5780 |
| |
5780 |
| - | |
| 5781 | + | |
5781 | 5782 |
| |
5782 | 5783 |
| |
5783 | 5784 |
| |
| |||
5814 | 5815 |
| |
5815 | 5816 |
| |
5816 | 5817 |
| |
| 5818 | + | |
| 5819 | + | |
| 5820 | + | |
| 5821 | + | |
| 5822 | + | |
| 5823 | + | |
| 5824 | + | |
5817 | 5825 |
| |
5818 | 5826 |
| |
5819 | 5827 |
| |
| |||
9840 | 9848 |
| |
9841 | 9849 |
| |
9842 | 9850 |
| |
| 9851 | + | |
| 9852 | + | |
| 9853 | + | |
| 9854 | + | |
| 9855 | + | |
| 9856 | + | |
9843 | 9857 |
| |
9844 | 9858 |
| |
9845 | 9859 |
| |
|
Lines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4653 | 4653 |
| |
4654 | 4654 |
| |
4655 | 4655 |
| |
4656 |
| - | |
4657 |
| - | |
4658 |
| - | |
| 4656 | + | |
4659 | 4657 |
| |
4660 | 4658 |
| |
4661 | 4659 |
| |
|
Lines changed: 26 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
23 | 23 |
| |
24 | 24 |
| |
25 | 25 |
| |
26 |
| - | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 |
| |
28 | 30 |
| |
29 | 31 |
| |
| |||
80 | 82 |
| |
81 | 83 |
| |
82 | 84 |
| |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
83 | 105 |
| |
84 | 106 |
| |
85 | 107 |
| |
| |||
102 | 124 |
| |
103 | 125 |
| |
104 | 126 |
| |
105 |
| - | |
| 127 | + | |
106 | 128 |
| |
107 | 129 |
| |
108 | 130 |
| |
| |||
118 | 140 |
| |
119 | 141 |
| |
120 | 142 |
| |
121 |
| - | |
| 143 | + | |
122 | 144 |
| |
123 | 145 |
| |
124 | 146 |
| |
| |||
300 | 322 |
| |
301 | 323 |
| |
302 | 324 |
| |
303 |
| - | |
| 325 | + | |
304 | 326 |
| |
305 | 327 |
| |
306 | 328 |
| |
|
Lines changed: 23 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 |
| |
26 | 28 |
| |
27 | 29 |
| |
| |||
110 | 112 |
| |
111 | 113 |
| |
112 | 114 |
| |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
113 | 130 |
| |
114 | 131 |
| |
115 | 132 |
| |
| |||
132 | 149 |
| |
133 | 150 |
| |
134 | 151 |
| |
135 |
| - | |
136 |
| - | |
137 |
| - | |
| 152 | + | |
| 153 | + | |
138 | 154 |
| |
139 | 155 |
| |
140 | 156 |
| |
| |||
148 | 164 |
| |
149 | 165 |
| |
150 | 166 |
| |
151 |
| - | |
152 |
| - | |
153 |
| - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
154 | 170 |
| |
155 | 171 |
| |
156 | 172 |
| |
| |||
347 | 363 |
| |
348 | 364 |
| |
349 | 365 |
| |
350 |
| - | |
351 |
| - | |
352 |
| - | |
353 |
| - | |
354 |
| - | |
355 |
| - | |
356 | 366 |
| |
357 | 367 |
| |
358 | 368 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1531 | 1531 |
| |
1532 | 1532 |
| |
1533 | 1533 |
| |
1534 |
| - | |
1535 |
| - | |
| 1534 | + | |
| 1535 | + | |
1536 | 1536 |
| |
1537 | 1537 |
| |
1538 | 1538 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
169 | 169 |
| |
170 | 170 |
| |
171 | 171 |
| |
| 172 | + | |
172 | 173 |
| |
173 | 174 |
| |
174 | 175 |
| |
|
Lines changed: 81 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
| 37 | + | |
37 | 38 |
| |
38 | 39 |
| |
39 | 40 |
| |
| |||
229 | 230 |
| |
230 | 231 |
| |
231 | 232 |
| |
232 |
| - | |
| 233 | + | |
233 | 234 |
| |
234 | 235 |
| |
235 | 236 |
| |
236 | 237 |
| |
237 | 238 |
| |
| 239 | + | |
238 | 240 |
| |
239 | 241 |
| |
240 | 242 |
| |
| |||
622 | 624 |
| |
623 | 625 |
| |
624 | 626 |
| |
625 |
| - | |
626 | 627 |
| |
627 | 628 |
| |
628 | 629 |
| |
629 | 630 |
| |
| 631 | + | |
630 | 632 |
| |
631 | 633 |
| |
632 | 634 |
| |
| |||
1221 | 1223 |
| |
1222 | 1224 |
| |
1223 | 1225 |
| |
| 1226 | + | |
1224 | 1227 |
| |
1225 | 1228 |
| |
1226 | 1229 |
| |
| |||
1236 | 1239 |
| |
1237 | 1240 |
| |
1238 | 1241 |
| |
1239 |
| - | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1240 | 1252 |
| |
1241 | 1253 |
| |
1242 | 1254 |
| |
| |||
1320 | 1332 |
| |
1321 | 1333 |
| |
1322 | 1334 |
| |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
1323 | 1349 |
| |
1324 | 1350 |
| |
1325 | 1351 |
| |
| |||
1352 | 1378 |
| |
1353 | 1379 |
| |
1354 | 1380 |
| |
1355 |
| - | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
1356 | 1390 |
| |
1357 | 1391 |
| |
1358 | 1392 |
| |
1359 | 1393 |
| |
1360 | 1394 |
| |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
1361 | 1409 |
| |
1362 | 1410 |
| |
1363 | 1411 |
| |
| |||
1369 | 1417 |
| |
1370 | 1418 |
| |
1371 | 1419 |
| |
1372 |
| - | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
1373 | 1429 |
| |
1374 | 1430 |
| |
1375 | 1431 |
| |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
1376 | 1446 |
| |
1377 | 1447 |
| |
1378 | 1448 |
| |
| |||
1590 | 1660 |
| |
1591 | 1661 |
| |
1592 | 1662 |
| |
1593 |
| - | |
1594 |
| - | |
| 1663 | + | |
| 1664 | + | |
1595 | 1665 |
| |
1596 | 1666 |
| |
1597 | 1667 |
| |
| |||
1601 | 1671 |
| |
1602 | 1672 |
| |
1603 | 1673 |
| |
1604 |
| - | |
| 1674 | + | |
1605 | 1675 |
| |
1606 | 1676 |
| |
1607 | 1677 |
| |
| |||
1614 | 1684 |
| |
1615 | 1685 |
| |
1616 | 1686 |
| |
| 1687 | + | |
| 1688 | + | |
1617 | 1689 |
| |
1618 | 1690 |
| |
1619 | 1691 |
| |
| |||
1630 | 1702 |
| |
1631 | 1703 |
| |
1632 | 1704 |
| |
| 1705 | + | |
1633 | 1706 |
| |
1634 | 1707 |
| |
1635 | 1708 |
| |
|
0 commit comments
Comments
(0)