pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Catch syntax error in generated column definition
Date: Mon, 01 Apr 2019 08:49:27 +0000
Message-ID: <E1hAsdD-00022I-Hh@gemulon.postgresql.org> (raw)

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(+)



Message-ID: <E1hAsdD-00022I-Hh@gemulon.postgresql.org>
Permalink:  ../E1hAsdD-00022I-Hh@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1hAsdD-00022I-Hh@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org
  Subject: Re: pgsql: Catch syntax error in generated column definition
  In-Reply-To: <E1hAsdD-00022I-Hh@gemulon.postgresql.org>
  References: <E1hAsdD-00022I-Hh@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox