forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit08bc189
committed
Fix printing of whole-row Vars at top level of a SELECT targetlist.
Normally whole-row Vars are printed as "tabname.*". However, that does notwork at top level of a targetlist, because per SQL standard the parser willthink that the "*" should result in column-by-column expansion; which isnot at all what a whole-row Var implies. We used to just print the tablename in such cases, which works most of the time; but it fails if the tablename matches a column name available anywhere in the FROM clause. Thiscould lead for instance to a view being interpreted differently after dumpand reload. Adding parentheses doesn't fix it, but there is a reasonablysimple kluge we can use instead: attach a no-op cast, so that the "*" isn'tsyntactically at top level anymore. This makes the printing of suchwhole-row Vars a lot more consistent with other Vars, and may indeed fixmore cases than just the reported one; I'm suspicious that cases involvingschema qualification probably didn't work properly before, either.Per bug report and fix proposal from Abbas Butt, though this patch is quitedifferent in detail from his.Back-patch to all supported versions.1 parent1869f00 commit08bc189
1 file changed
+32
-13
lines changedLines changed: 32 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
203 | 203 |
| |
204 | 204 |
| |
205 | 205 |
| |
206 |
| - | |
| 206 | + | |
207 | 207 |
| |
208 | 208 |
| |
209 | 209 |
| |
| |||
3013 | 3013 |
| |
3014 | 3014 |
| |
3015 | 3015 |
| |
3016 |
| - | |
| 3016 | + | |
| 3017 | + | |
3017 | 3018 |
| |
3018 | 3019 |
| |
3019 | 3020 |
| |
3020 |
| - | |
| 3021 | + | |
3021 | 3022 |
| |
3022 | 3023 |
| |
3023 | 3024 |
| |
| |||
3684 | 3685 |
| |
3685 | 3686 |
| |
3686 | 3687 |
| |
3687 |
| - | |
3688 |
| - | |
| 3688 | + | |
| 3689 | + | |
| 3690 | + | |
| 3691 | + | |
| 3692 | + | |
| 3693 | + | |
| 3694 | + | |
| 3695 | + | |
3689 | 3696 |
| |
3690 |
| - | |
| 3697 | + | |
| 3698 | + | |
3691 | 3699 |
| |
3692 | 3700 |
| |
3693 |
| - | |
| 3701 | + | |
3694 | 3702 |
| |
3695 | 3703 |
| |
3696 | 3704 |
| |
| |||
3857 | 3865 |
| |
3858 | 3866 |
| |
3859 | 3867 |
| |
3860 |
| - | |
| 3868 | + | |
3861 | 3869 |
| |
3862 | 3870 |
| |
3863 |
| - | |
| 3871 | + | |
| 3872 | + | |
| 3873 | + | |
| 3874 | + | |
| 3875 | + | |
| 3876 | + | |
| 3877 | + | |
3864 | 3878 |
| |
3865 | 3879 |
| |
3866 | 3880 |
| |
| |||
3876 | 3890 |
| |
3877 | 3891 |
| |
3878 | 3892 |
| |
3879 |
| - | |
3880 |
| - | |
| 3893 | + | |
3881 | 3894 |
| |
3882 | 3895 |
| |
3883 | 3896 |
| |
3884 |
| - | |
| 3897 | + | |
| 3898 | + | |
3885 | 3899 |
| |
| 3900 | + | |
| 3901 | + | |
| 3902 | + | |
| 3903 | + | |
| 3904 | + | |
3886 | 3905 |
| |
3887 | 3906 |
| |
3888 | 3907 |
| |
| |||
4819 | 4838 |
| |
4820 | 4839 |
| |
4821 | 4840 |
| |
4822 |
| - | |
| 4841 | + | |
4823 | 4842 |
| |
4824 | 4843 |
| |
4825 | 4844 |
| |
|
0 commit comments
Comments
(0)