forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commita3ca72a
committed
Fix dumping of FUNCTION RTEs that contain non-function-call expressions.
The grammar will only accept something syntactically similar to a functioncall in a function-in-FROM expression. However, there are various waysto input something that ruleutils.c won't deparse that way, potentiallyleading to a view or rule that fails dump/reload. Fix by inserting adummy CAST around anything that isn't going to deparse as a function(which is one of the ways to get something like that in there in thefirst place).In HEAD, also make use of the infrastructure added by this to avoidemitting unnecessary parentheses in CREATE INDEX deparsing. I didnot change that in back branches, thinking that people might find itto be unexpected/unnecessary behavioral change.In HEAD, also fix incorrect logic for when to add extra parens topartition key expressions. Somebody apparently thought they couldget away with simpler logic than pg_get_indexdef_worker has, butthey were wrong --- a counterexample is PARTITION BY LIST ((a[1])).Ignoring the prettyprint flag for partition expressions isn't exactlya nice solution anyway.This has been broken all along, so back-patch to all supported branches.Discussion:https://postgr.es/m/10477.1499970459@sss.pgh.pa.us1 parent2036f71 commita3ca72a
File tree
4 files changed
+110
-7
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
4 files changed
+110
-7
lines changedLines changed: 71 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
416 | 416 |
| |
417 | 417 |
| |
418 | 418 |
| |
| 419 | + | |
| 420 | + | |
| 421 | + | |
419 | 422 |
| |
420 | 423 |
| |
421 | 424 |
| |
| |||
1308 | 1311 |
| |
1309 | 1312 |
| |
1310 | 1313 |
| |
1311 |
| - | |
1312 |
| - | |
| 1314 | + | |
1313 | 1315 |
| |
1314 | 1316 |
| |
1315 | 1317 |
| |
| |||
1698 | 1700 |
| |
1699 | 1701 |
| |
1700 | 1702 |
| |
| 1703 | + | |
1701 | 1704 |
| |
1702 | 1705 |
| |
1703 |
| - | |
| 1706 | + | |
| 1707 | + | |
| 1708 | + | |
| 1709 | + | |
| 1710 | + | |
| 1711 | + | |
1704 | 1712 |
| |
1705 |
| - | |
1706 | 1713 |
| |
1707 | 1714 |
| |
1708 | 1715 |
| |
| |||
8776 | 8783 |
| |
8777 | 8784 |
| |
8778 | 8785 |
| |
| 8786 | + | |
| 8787 | + | |
| 8788 | + | |
| 8789 | + | |
| 8790 | + | |
| 8791 | + | |
| 8792 | + | |
| 8793 | + | |
| 8794 | + | |
| 8795 | + | |
| 8796 | + | |
| 8797 | + | |
| 8798 | + | |
| 8799 | + | |
| 8800 | + | |
| 8801 | + | |
| 8802 | + | |
| 8803 | + | |
| 8804 | + | |
| 8805 | + | |
| 8806 | + | |
| 8807 | + | |
| 8808 | + | |
| 8809 | + | |
| 8810 | + | |
| 8811 | + | |
| 8812 | + | |
| 8813 | + | |
| 8814 | + | |
| 8815 | + | |
| 8816 | + | |
| 8817 | + | |
| 8818 | + | |
| 8819 | + | |
| 8820 | + | |
| 8821 | + | |
| 8822 | + | |
| 8823 | + | |
| 8824 | + | |
| 8825 | + | |
| 8826 | + | |
| 8827 | + | |
| 8828 | + | |
| 8829 | + | |
| 8830 | + | |
| 8831 | + | |
| 8832 | + | |
| 8833 | + | |
| 8834 | + | |
| 8835 | + | |
| 8836 | + | |
| 8837 | + | |
| 8838 | + | |
| 8839 | + | |
| 8840 | + | |
| 8841 | + | |
| 8842 | + | |
| 8843 | + | |
8779 | 8844 |
| |
8780 | 8845 |
| |
8781 | 8846 |
| |
| |||
9749 | 9814 |
| |
9750 | 9815 |
| |
9751 | 9816 |
| |
9752 |
| - | |
| 9817 | + | |
9753 | 9818 |
| |
9754 | 9819 |
| |
9755 | 9820 |
| |
| |||
9812 | 9877 |
| |
9813 | 9878 |
| |
9814 | 9879 |
| |
9815 |
| - | |
| 9880 | + | |
9816 | 9881 |
| |
9817 | 9882 |
| |
9818 | 9883 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
434 | 434 |
| |
435 | 435 |
| |
436 | 436 |
| |
437 |
| - | |
| 437 | + | |
438 | 438 |
| |
439 | 439 |
| |
440 | 440 |
| |
|
Lines changed: 26 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1622 | 1622 |
| |
1623 | 1623 |
| |
1624 | 1624 |
| |
| 1625 | + | |
| 1626 | + | |
| 1627 | + | |
| 1628 | + | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
| 1633 | + | |
| 1634 | + | |
| 1635 | + | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
| 1642 | + | |
| 1643 | + | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
1625 | 1651 |
| |
1626 | 1652 |
| |
1627 | 1653 |
| |
|
Lines changed: 12 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
547 | 547 |
| |
548 | 548 |
| |
549 | 549 |
| |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
550 | 562 |
| |
551 | 563 |
| |
552 | 564 |
| |
|
0 commit comments
Comments
(0)