Missing docs on AT TIME ZONE precedence?
Shay Rojansky <roji@roji.org>
From: Shay Rojansky <roji@roji.org>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-11-26T10:13:39Z
Lists: pgsql-hackers
Greeting hackers, In the operator precedence table[1] table, AT TIME ZONE isn't explicitly listed out; that means it's to be interpreted in the "any other operator category". However, it seems that the precedence of AT TIME ZONE is actually higher than that of the addition operator: -- Fails with "function pg_catalog.timezone(unknown, interval) does not exist SELECT now() + INTERVAL '14 days' AT TIME ZONE 'UTC'; -- Works: SELECT (now() + INTERVAL '14 days') AT TIME ZONE 'UTC'; Note that missing parentheses for this were discussed in the context of pg_catalog.pg_get_viewdef[2]. Is there a missing line in the operator precedence table in the docs? Thanks, Shay [1] https://www.postgresql.org/docs/current/sql-syntax-lexical.html#SQL-PRECEDENCE [2] https://www.postgresql.org/message-id/flat/f41566aa-a057-6628-4b7c-b48770ecb84a@deepbluecap.com
Commits
-
Clean up usage of bison precedence for non-operator keywords.
- a916b47e2329 17.0 landed
-
Doc: list AT TIME ZONE and COLLATE in operator precedence table.
- 3558f120f869 17.0 landed
- c7bd476049ca 15.6 landed
- 9033e7019821 16.2 landed
- 69a9134326f2 13.14 landed
- 648fc6a1c459 14.11 landed
- 450ad6585ac5 12.18 landed
-
SQL/JSON: support the IS JSON predicate
- 6ee30209a6f1 16.0 cited