pgsql: Apply identity sequence values on COPY

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Apply identity sequence values on COPY
Date: 2017-12-08 14:43:28
Message-ID: E1eNJs8-0005T6-6h@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Apply identity sequence values on COPY

A COPY into a table should apply identity sequence values just like it
does for ordinary defaults. This was previously forgotten, leading to
null values being inserted, which in turn would fail because identity
columns have not-null constraints.

Author: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Reported-by: Steven Winfield <steven(dot)winfield(at)cantabcapital(dot)com>
Bug: #14952

Branch
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/ee5b595493e1609903d55709853f5276ba85c81d

Modified Files
--------------
src/backend/commands/copy.c | 16 ++++++++++++++--
src/test/regress/expected/identity.out | 13 +++++++++++++
src/test/regress/sql/identity.sql | 17 +++++++++++++++++
3 files changed, 44 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2017-12-08 15:22:48 pgsql: Accept SCRAM channel binding enabled clients
Previous Message Andres Freund 2017-12-07 20:46:22 Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple