lei-jia-xing opened a new issue, #3039:
URL: https://github.com/apache/datafusion-sqlparser-rs/issues/3039
`PostgreSqlDialect` accepts `(TABLE t);` but rejects `TABLE t;` at the start
of a statement. PostgreSQL documents `TABLE t` as shorthand for `SELECT * FROM
t`.
### Reproduction
With `sqlparser = "=0.64.0"`:
```rust
use sqlparser::{dialect::PostgreSqlDialect, parser::Parser};
fn main() {
for sql in ["TABLE t;", "(TABLE t);"] {
match Parser::parse_sql(&PostgreSqlDialect {}, sql) {
Ok(_) => println!("{sql} => OK"),
Err(error) => println!("{sql} => {error}"),
}
}
}
```
### Actual behavior
```text
TABLE t; => sql parser error: Expected: an SQL statement, found: TABLE at
Line: 1, Column: 1
(TABLE t); => OK
```
### Expected behavior
Parse `TABLE t;` as a single query statement without requiring parentheses.
[PostgreSQL SELECT
documentation](https://www.postgresql.org/docs/current/sql-select.html)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]