]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Only evaluate default values as required when doing COPY FROM
authorAndrew Dunstan <andrew@dunslane.net>
Sun, 1 Oct 2023 14:18:41 +0000 (10:18 -0400)
committerAndrew Dunstan <andrew@dunslane.net>
Sun, 1 Oct 2023 14:25:33 +0000 (10:25 -0400)
commit910eb61b2bbdb729c242ed20d5f6e0a392eb62da
tree9af6f16220418332c163499bc13ba3b7d3a34ca2
parentd5c5312dc8b66b4ad652ec54ed32029d621e1e93
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
src/backend/commands/copyfrom.c
src/test/regress/expected/copy.out
src/test/regress/sql/copy.sql