pgsql: Only evaluate default values as required when doing COPY FROM - Mailing list pgsql-committers

From Andrew Dunstan
Subject pgsql: Only evaluate default values as required when doing COPY FROM
Date
Msg-id E1qmxOR-006zZn-HM@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Only evaluate default values as required when doing COPY FROM

Commit 9f8377f7a2 was a little too eager in fetching default values.
Normally this would not matter, but if the default value is not valid
for the type (e.g. a varchar that's too long) it caused an unnecessary
error.

Complaint and fix from Laurenz Albe

Backpatch to release 16.

Discussion: https://postgr.es/m/75a7b7483aeb331aa017328d606d568fc715b90d.camel@cybertec.at

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/910eb61b2bbdb729c242ed20d5f6e0a392eb62da

Modified Files
--------------
src/backend/commands/copyfrom.c    |  9 ++++++++-
src/test/regress/expected/copy.out | 17 +++++++++++++++++
src/test/regress/sql/copy.sql      | 15 +++++++++++++++
3 files changed, 40 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Andres Freund
Date:
Subject: pgsql: meson: macos: Correct -exported_symbols_list syntax for Sonoma c
Next
From: Tom Lane
Date:
Subject: pgsql: In COPY FROM, fail cleanly when unsupported encoding conversion