Skip to content

PostgreSQL: Support AT LOCAL - #3060

Open
LucaCappelletti94 wants to merge 2 commits into
mainfrom
upstream/postgres-at-local
Open

LucaCappelletti94 wants to merge 2 commits into
mainfrom
upstream/postgres-at-local

Conversation

@LucaCappelletti94

Copy link
Copy Markdown
Contributor

PostgreSQL 17 added AT LOCAL, which converts a timestamp to the session time zone like AT TIME ZONE current_setting('TimeZone') (docs). The parser only knew AT TIME ZONE, so SELECT CAST((CAST(NULL AS timestamptz) AT LOCAL) AS TEXT) failed with Expected: ), found: AT.

This PR adds Expr::AtLocal, parsed behind a new Dialect::supports_at_local enabled for PostgreSQL and Generic. It takes the AT TIME ZONE precedence as in the PostgreSQL grammar, so it binds tighter than + and chains left with AT TIME ZONE.

@codecov-commenter

codecov-commenter commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.58%. Comparing base (b3bc3df) to head (f4fd5e4).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/parser/mod.rs 60.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3060      +/-   ##
==========================================
+ Coverage   83.57%   83.58%   +0.01%     
==========================================
  Files          42       42              
  Lines       35719    35740      +21     
  Branches    35719    35740      +21     
==========================================
+ Hits        29853    29875      +22     
+ Misses       2425     2424       -1     
  Partials     3441     3441              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants