Commit f893e68
committed
Add select_common_typmod()
This accompanies select_common_type() and select_common_collation().
Typmods were previously combined using hand-coded logic in several
places. The logic in select_common_typmod() isn't very exciting, but
it makes the code more compact and readable in a few locations, and in
the future we can perhaps do more complicated things if desired.
As a small enhancement, the type unification of the direct and
aggregate arguments of hypothetical-set aggregates now unifies the
typmod as well using this new function, instead of just dropping it.
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://www.postgresql.org/message-id/flat/97df3af9-8b5e-fb7f-a029-3eb7e80d7af9@2ndquadrant.com1 parent 59ab4ac commit f893e68
File tree
5 files changed
+57
-39
lines changed- src
- backend/parser
- include/parser
5 files changed
+57
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1434 | 1434 | | |
1435 | 1435 | | |
1436 | 1436 | | |
1437 | | - | |
| 1437 | + | |
1438 | 1438 | | |
1439 | | - | |
1440 | 1439 | | |
1441 | 1440 | | |
1442 | 1441 | | |
| |||
1446 | 1445 | | |
1447 | 1446 | | |
1448 | 1447 | | |
1449 | | - | |
1450 | | - | |
1451 | | - | |
1452 | | - | |
1453 | | - | |
1454 | | - | |
1455 | | - | |
1456 | | - | |
1457 | | - | |
1458 | | - | |
1459 | | - | |
1460 | 1448 | | |
1461 | 1449 | | |
| 1450 | + | |
1462 | 1451 | | |
1463 | 1452 | | |
1464 | 1453 | | |
| |||
2020 | 2009 | | |
2021 | 2010 | | |
2022 | 2011 | | |
2023 | | - | |
2024 | | - | |
2025 | 2012 | | |
2026 | 2013 | | |
2027 | 2014 | | |
| |||
2034 | 2021 | | |
2035 | 2022 | | |
2036 | 2023 | | |
2037 | | - | |
2038 | | - | |
2039 | | - | |
2040 | | - | |
2041 | | - | |
2042 | 2024 | | |
2043 | 2025 | | |
2044 | 2026 | | |
| |||
2089 | 2071 | | |
2090 | 2072 | | |
2091 | 2073 | | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
2092 | 2078 | | |
2093 | 2079 | | |
2094 | 2080 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1568 | 1568 | | |
1569 | 1569 | | |
1570 | 1570 | | |
1571 | | - | |
1572 | | - | |
1573 | | - | |
1574 | | - | |
1575 | | - | |
1576 | | - | |
1577 | | - | |
1578 | | - | |
| 1571 | + | |
| 1572 | + | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
1579 | 1576 | | |
1580 | | - | |
1581 | | - | |
1582 | | - | |
1583 | | - | |
1584 | | - | |
1585 | | - | |
1586 | | - | |
1587 | | - | |
1588 | | - | |
| 1577 | + | |
1589 | 1578 | | |
1590 | 1579 | | |
1591 | 1580 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1522 | 1522 | | |
1523 | 1523 | | |
1524 | 1524 | | |
| 1525 | + | |
| 1526 | + | |
| 1527 | + | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
| 1536 | + | |
| 1537 | + | |
| 1538 | + | |
| 1539 | + | |
| 1540 | + | |
| 1541 | + | |
| 1542 | + | |
| 1543 | + | |
| 1544 | + | |
| 1545 | + | |
| 1546 | + | |
| 1547 | + | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
| 1553 | + | |
| 1554 | + | |
| 1555 | + | |
| 1556 | + | |
| 1557 | + | |
| 1558 | + | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
1525 | 1562 | | |
1526 | 1563 | | |
1527 | 1564 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1750 | 1750 | | |
1751 | 1751 | | |
1752 | 1752 | | |
| 1753 | + | |
1753 | 1754 | | |
1754 | 1755 | | |
1755 | 1756 | | |
| |||
1768 | 1769 | | |
1769 | 1770 | | |
1770 | 1771 | | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
1771 | 1775 | | |
1772 | 1776 | | |
1773 | 1777 | | |
| |||
1776 | 1780 | | |
1777 | 1781 | | |
1778 | 1782 | | |
1779 | | - | |
| 1783 | + | |
1780 | 1784 | | |
1781 | 1785 | | |
1782 | 1786 | | |
1783 | 1787 | | |
1784 | 1788 | | |
1785 | 1789 | | |
1786 | 1790 | | |
1787 | | - | |
| 1791 | + | |
1788 | 1792 | | |
1789 | 1793 | | |
1790 | 1794 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
74 | 76 | | |
75 | 77 | | |
76 | 78 | | |
| |||
0 commit comments