mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-24 23:37:03 +08:00
Fix under-parenthesized display of AT TIME ZONE constructs.
In commit 40c24bfef, 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.com
This commit is contained in:
@ -703,6 +703,7 @@ select pg_get_viewdef('tt20v', true);
|
||||
|
||||
create view tt201v as
|
||||
select
|
||||
('2022-12-01'::date + '1 day'::interval) at time zone 'UTC' as atz,
|
||||
extract(day from now()) as extr,
|
||||
(now(), '1 day'::interval) overlaps
|
||||
(current_timestamp(2), '1 day'::interval) as o,
|
||||
|
||||
Reference in New Issue
Block a user