zvonimir-dd opened a new pull request, #2626:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2626
<!-- comma separated, or `none` -->
Dialects: PostgreSQL
Closes #2624.
PostgreSQL's `INSERT` takes `OVERRIDING { SYSTEM | USER } VALUE` between the
column list and the source:
```sql
INSERT INTO t (id, a) OVERRIDING SYSTEM VALUE VALUES (1, 'x')
INSERT INTO t OVERRIDING USER VALUE SELECT * FROM u
```
- Adds an `OVERRIDING` keyword, an `InsertOverriding { System, User }` enum
and an `Insert::overriding` field. The clause is parsed after the column list
(and the Hive/Databricks clauses that follow it), and printed back in the same
position, so statements round-trip.
- PostgreSQL accepts an `INSERT` table alias without `AS`, so without a
column list `OVERRIDING` was read as the alias. It is now excluded from the
implicit alias, as `BY NAME` already is (`OVERRIDING` followed by `SYSTEM` or
`USER` only).
- Tests in `tests/sqlparser_postgres.rs` cover:
- both kinds, with VALUES and with a query source;
- no column list, with an explicit alias, and followed by `ON CONFLICT …
RETURNING`;
- that a plain `INSERT` has no clause;
- malformed `OVERRIDING` forms are rejected.
--
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]