forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb6d6400
committed
Ensure that pg_get_ruledef()'s output matches pg_get_viewdef()'s.
Various cases involving renaming of view columns are handled by havingmake_viewdef pass down the view's current relation tupledesc toget_query_def, which then takes care to use the column names from thetupledesc for the output column names of the SELECT. For some reasonthough, we'd missed teaching make_ruledef to do similarly when it isprinting an ON SELECT rule, even though this is exactly the same case.The results from pg_get_ruledef would then be different and arguably wrong.In particular, this breaks pre-v10 versions of pg_dump, which in somesituations would define views by means of emitting a CREATE RULE ... ONSELECT command. Third-party tools might not be happy either.In passing, clean up some crufty code in make_viewdef; we'd apparentlymodernized the equivalent code in make_ruledef somewhere along the way,and missed this copy.Per report from Gilles Darold. Back-patch to all supported versions.Discussion:https://postgr.es/m/ec05659a-40ff-4510-fc45-ca9d965d0838@dalibo.com1 parent9842c1b commitb6d6400
File tree
3 files changed
+49
-2
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+49
-2
lines changedLines changed: 9 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3885 | 3885 |
| |
3886 | 3886 |
| |
3887 | 3887 |
| |
| 3888 | + | |
| 3889 | + | |
3888 | 3890 |
| |
3889 | 3891 |
| |
3890 | 3892 |
| |
| |||
3926 | 3928 |
| |
3927 | 3929 |
| |
3928 | 3930 |
| |
| 3931 | + | |
| 3932 | + | |
3929 | 3933 |
| |
3930 | 3934 |
| |
3931 | 3935 |
| |
| |||
3942 | 3946 |
| |
3943 | 3947 |
| |
3944 | 3948 |
| |
| 3949 | + | |
3945 | 3950 |
| |
3946 | 3951 |
| |
3947 | 3952 |
| |
| |||
4034 | 4039 |
| |
4035 | 4040 |
| |
4036 | 4041 |
| |
4037 |
| - | |
| 4042 | + | |
4038 | 4043 |
| |
4039 | 4044 |
| |
4040 | 4045 |
| |
| |||
4052 | 4057 |
| |
4053 | 4058 |
| |
4054 | 4059 |
| |
4055 |
| - | |
| 4060 | + | |
4056 | 4061 |
| |
4057 | 4062 |
| |
4058 | 4063 |
| |
| 4064 | + | |
| 4065 | + | |
4059 | 4066 |
| |
4060 | 4067 |
| |
4061 | 4068 |
| |
|
Lines changed: 29 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1619 | 1619 |
| |
1620 | 1620 |
| |
1621 | 1621 |
| |
| 1622 | + | |
| 1623 | + | |
| 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 | + | |
1622 | 1651 |
| |
1623 | 1652 |
| |
1624 | 1653 |
| |
|
Lines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
541 | 541 |
| |
542 | 542 |
| |
543 | 543 |
| |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
544 | 555 |
| |
545 | 556 |
| |
546 | 557 |
| |
|
0 commit comments
Comments
(0)