pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Allow a multi-row INSERT to specify DEFAULTs for a generated col
Date: 2020-11-22 20:48:47
Message-ID: E1kgwHv-0005bF-Ht@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Allow a multi-row INSERT to specify DEFAULTs for a generated column.

One can say "INSERT INTO tab(generated_col) VALUES (DEFAULT)" and not
draw an error. But the equivalent case for a multi-row VALUES list
always threw an error, even if one properly said DEFAULT in each row.
Fix that. While here, improve the test cases for nearby logic about
OVERRIDING SYSTEM/USER values.

Dean Rasheed

Discussion: https://postgr.es/m/9q0sgcr416t.fsf@gmx.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/17958972fe3bb03454a4b53756b29d65dc285efa

Modified Files
--------------
src/backend/rewrite/rewriteHandler.c | 242 ++++++++++++++++++++++++++++----
src/test/regress/expected/generated.out | 47 ++++++-
src/test/regress/expected/identity.out | 56 ++++++++
src/test/regress/sql/generated.sql | 21 ++-
src/test/regress/sql/identity.sql | 23 +++
5 files changed, 357 insertions(+), 32 deletions(-)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2020-11-23 09:17:03 pgsql: Split copy.c into four files.
Previous Message Tom Lane 2020-11-21 22:30:53 pgsql: In geo_ops.c, represent infinite slope as Infinity, not DBL_MAX.