Skip to content

Parser: Accept TABLE as a top-level query - #3064

Open
yussypu wants to merge 1 commit into
apache:mainfrom
yussypu:pg-top-level-table
Open

yussypu wants to merge 1 commit into
apache:mainfrom
yussypu:pg-top-level-table

Conversation

@yussypu

@yussypu yussypu commented Nov 28, 2026

Copy link
Copy Markdown

Dialects: PostgreSQL

Closes #3039

TABLE t; failed with Expected: an SQL statement, found: TABLE, while (TABLE t); parsed. PostgreSQL documents TABLE name as shorthand for SELECT * FROM name: https://www.postgresql.org/docs/current/sql-select.html#SQL-TABLE

parse_statement now starts a query at TABLE, as parse_query_body already did. In ClickHouse and Snowflake, where DESCRIBE TABLE t describes a table, EXPLAIN TABLE t keeps that meaning; elsewhere it explains the TABLE t query.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.59%. Comparing base (ca4383f) to head (35377cd).

Files with missing lines Patch % Lines
src/parser/mod.rs 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3064   +/-   ##
=======================================
  Coverage   83.59%   83.59%           
=======================================
  Files          42       42           
  Lines       35732    35736    +4     
  Branches    35732    35736    +4     
=======================================
+ Hits        29871    29875    +4     
  Misses       2420     2420           
  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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PostgreSQL: Accept TABLE as a top-level query

2 participants