Catch syntax error in generated column definition
Peter Eisentraut <peter@eisentraut.org>
Catch syntax error in generated column definition
The syntax
GENERATED BY DEFAULT AS (expr)
is not allowed but we have to accept it in the grammar to avoid
shift/reduce conflicts because of the similar syntax for identity
columns. The existing code just ignored this, incorrectly. Add an
explicit error check and a bespoke error message.
Reported-by: Justin Pryzby <pryzby@telsasoft.com>
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/parser/gram.y | modified | +13 −0 |
| src/test/regress/expected/generated.out | modified | +5 −0 |
| src/test/regress/sql/generated.sql | modified | +3 −0 |