pgsql: Catch syntax error in generated column definition - Mailing list pgsql-committers

From Peter Eisentraut
Subject pgsql: Catch syntax error in generated column definition
Date
Msg-id E1hAsdD-00022I-Hh@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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>

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/7241911782a7420e38b6e50b57d304ea48bc5362

Modified Files
--------------
src/backend/parser/gram.y               | 13 +++++++++++++
src/test/regress/expected/generated.out |  5 +++++
src/test/regress/sql/generated.sql      |  3 +++
3 files changed, 21 insertions(+)


pgsql-committers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: pgsql: Compute XID horizon for page level index vacuum on primary.
Next
From: Alexander Korotkov
Date:
Subject: pgsql: Throw error in jsonb_path_match() when result is not singlebool