Commit 1dd6700
committed
Fix under-parenthesized display of AT TIME ZONE constructs.
In commit 40c24bf, I forgot to use get_rule_expr_paren() for the
arguments of AT TIME ZONE, resulting in possibly not printing parens
for expressions that need it. But get_rule_expr_paren() wouldn't have
gotten it right anyway, because isSimpleNode() hadn't been taught that
COERCE_SQL_SYNTAX parent nodes don't guarantee sufficient parentheses.
Improve all that. Also use this methodology for F_IS_NORMALIZED, so
that we don't print useless parens for that.
In passing, remove a comment that was obsoleted later.
Per report from Duncan Sands. Back-patch to v14 where this code
came in. (Before that, we didn't try to print AT TIME ZONE that way,
so there was no bug just ugliness.)
Discussion: https://postgr.es/m/f41566aa-a057-6628-4b7c-b48770ecb84a@deepbluecap.com1 parent 4dd00b0 commit 1dd6700
File tree
3 files changed
+20
-17
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+20
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8254 | 8254 | | |
8255 | 8255 | | |
8256 | 8256 | | |
8257 | | - | |
| 8257 | + | |
8258 | 8258 | | |
8259 | 8259 | | |
8260 | 8260 | | |
8261 | | - | |
| 8261 | + | |
| 8262 | + | |
8262 | 8263 | | |
8263 | 8264 | | |
8264 | 8265 | | |
| |||
8306 | 8307 | | |
8307 | 8308 | | |
8308 | 8309 | | |
8309 | | - | |
| 8310 | + | |
8310 | 8311 | | |
8311 | 8312 | | |
8312 | 8313 | | |
8313 | | - | |
| 8314 | + | |
| 8315 | + | |
8314 | 8316 | | |
8315 | 8317 | | |
8316 | 8318 | | |
| |||
10046 | 10048 | | |
10047 | 10049 | | |
10048 | 10050 | | |
10049 | | - | |
| 10051 | + | |
| 10052 | + | |
10050 | 10053 | | |
10051 | | - | |
| 10054 | + | |
| 10055 | + | |
10052 | 10056 | | |
10053 | 10057 | | |
10054 | 10058 | | |
| |||
10100 | 10104 | | |
10101 | 10105 | | |
10102 | 10106 | | |
10103 | | - | |
10104 | | - | |
10105 | | - | |
| 10107 | + | |
| 10108 | + | |
| 10109 | + | |
| 10110 | + | |
10106 | 10111 | | |
10107 | 10112 | | |
10108 | 10113 | | |
| |||
10123 | 10128 | | |
10124 | 10129 | | |
10125 | 10130 | | |
10126 | | - | |
10127 | | - | |
10128 | | - | |
10129 | | - | |
10130 | | - | |
10131 | 10131 | | |
10132 | 10132 | | |
10133 | 10133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1922 | 1922 | | |
1923 | 1923 | | |
1924 | 1924 | | |
| 1925 | + | |
1925 | 1926 | | |
1926 | 1927 | | |
1927 | 1928 | | |
| |||
1976 | 1977 | | |
1977 | 1978 | | |
1978 | 1979 | | |
1979 | | - | |
| 1980 | + | |
| 1981 | + | |
1980 | 1982 | | |
1981 | | - | |
1982 | | - | |
| 1983 | + | |
| 1984 | + | |
1983 | 1985 | | |
1984 | 1986 | | |
1985 | 1987 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
| 706 | + | |
706 | 707 | | |
707 | 708 | | |
708 | 709 | | |
| |||
0 commit comments