Add support for TABLE command in Postgresql#2364
Conversation
| ); | ||
|
|
||
| for sql in [ | ||
| "TABLE films WHERE x > 0", |
There was a problem hiding this comment.
might be interesting to test: TABLE db.schema.table is rejected.
There was a problem hiding this comment.
Currently it is accepted. Based on the existing design philosophy I thought the parser should be permissive on this and relies on downstream semantic analyzer to do verification. But I want to get your opinion on this and will be happy to make the change rejecting this with a trait method
| dialects.verified_stmt("TABLE films"); | ||
| // Schema-qualified. | ||
| dialects.verified_stmt("TABLE myschema.films"); | ||
| // Database-qualified (three-part name). |
There was a problem hiding this comment.
this is for MySQL, not PostgreSQL, right ? Maybe a subtle overlap with another PR to come for MySQL ?
There was a problem hiding this comment.
Yes, actually I will enable this command and add mysql testing in the next revision as well since this implementation works for both
Hi. FYI, we have similar plan at Data Bene for Oracle/PG. |
Hi all. We're an AWS team using sqlparser-rs for MySQL/PG parsing and plan to contribute a series of dialect compatibility improvements. Happy to coordinate on approach.
Change Description:
This closes Issue: #742
Renamed Table struct → ExplicitTable. The original Table struct was created for only one specific use case: CREATE TABLE x AS TABLE y.
The new name matches is more precise and matches SQL:2016 terminology.
Grammar: https://www.postgresql.org/docs/current/sql-select.html#SQL-TABLE