forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit14f9fb5
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 parenta6708e2 commit14f9fb5
1 file changed
+32
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
2822 | 2822 | | |
2823 | 2823 | | |
2824 | 2824 | | |
2825 | | - | |
| 2825 | + | |
| 2826 | + | |
2826 | 2827 | | |
2827 | 2828 | | |
2828 | 2829 | | |
2829 | | - | |
| 2830 | + | |
2830 | 2831 | | |
2831 | 2832 | | |
2832 | 2833 | | |
| |||
3539 | 3540 | | |
3540 | 3541 | | |
3541 | 3542 | | |
3542 | | - | |
3543 | | - | |
| 3543 | + | |
| 3544 | + | |
| 3545 | + | |
| 3546 | + | |
| 3547 | + | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
3544 | 3551 | | |
3545 | | - | |
| 3552 | + | |
| 3553 | + | |
3546 | 3554 | | |
3547 | 3555 | | |
3548 | | - | |
| 3556 | + | |
3549 | 3557 | | |
3550 | 3558 | | |
3551 | 3559 | | |
| |||
3724 | 3732 | | |
3725 | 3733 | | |
3726 | 3734 | | |
3727 | | - | |
| 3735 | + | |
3728 | 3736 | | |
3729 | 3737 | | |
3730 | | - | |
| 3738 | + | |
| 3739 | + | |
| 3740 | + | |
| 3741 | + | |
| 3742 | + | |
| 3743 | + | |
| 3744 | + | |
3731 | 3745 | | |
3732 | 3746 | | |
3733 | 3747 | | |
| |||
3743 | 3757 | | |
3744 | 3758 | | |
3745 | 3759 | | |
3746 | | - | |
3747 | | - | |
| 3760 | + | |
3748 | 3761 | | |
3749 | 3762 | | |
3750 | 3763 | | |
3751 | | - | |
| 3764 | + | |
| 3765 | + | |
3752 | 3766 | | |
| 3767 | + | |
| 3768 | + | |
| 3769 | + | |
| 3770 | + | |
| 3771 | + | |
3753 | 3772 | | |
3754 | 3773 | | |
3755 | 3774 | | |
| |||
4489 | 4508 | | |
4490 | 4509 | | |
4491 | 4510 | | |
4492 | | - | |
| 4511 | + | |
4493 | 4512 | | |
4494 | 4513 | | |
4495 | 4514 | | |
| |||
0 commit comments
Comments
(0)