pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Only evaluate default values as required when doing COPY FROM
Date: Sun, 01 Oct 2023 14:25:59 +0000
Message-ID: <E1qmxOR-006zZm-Gu@gemulon.postgresql.org> (raw)

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/276393f53efbf08f72190221e9c1ef2a28e7fc66

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



view thread (2+ messages)  latest in thread

Message-ID: <E1qmxOR-006zZm-Gu@gemulon.postgresql.org>
Permalink:  ../E1qmxOR-006zZm-Gu@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1qmxOR-006zZm-Gu@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: andrew@dunslane.net, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Only evaluate default values as required when doing COPY FROM
  In-Reply-To: <E1qmxOR-006zZm-Gu@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