ting-hong-shieh opened a new pull request, #2441:
URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2441
Fixes #2407.
`PostgreSqlDialect` required `STORED` after `GENERATED ALWAYS AS (expr)`, so
it rejected both the omitted mode and an explicit `VIRTUAL`:
```
CREATE TABLE users (..., name character varying(255)
GENERATED ALWAYS AS (((first_name || ' '::text) || last_name)) NOT NULL);
-- Expected: STORED, found: NOT at Line: 6, Column: 9
CREATE TABLE users (a text, name text GENERATED ALWAYS AS (a) VIRTUAL);
-- Expected: STORED, found: VIRTUAL at Line: 1, Column: 63
```
PostgreSQL 18 documents the grammar as `GENERATED ALWAYS AS (
generation_expr ) [ STORED | VIRTUAL ]`, with `VIRTUAL` as the default when the
keyword is omitted.
This removes the `PostgreSqlDialect` special case so the dialect falls back
to the shared handling, which already parses both forms and round-trips them
unchanged. `STORED` is unaffected.
--
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]