Regression in COPY FROM caused by 9f8377f7a2 - Mailing list pgsql-hackers

From Laurenz Albe
Subject Regression in COPY FROM caused by 9f8377f7a2
Date
Msg-id 75a7b7483aeb331aa017328d606d568fc715b90d.camel@cybertec.at
Whole thread Raw
Responses Re: Regression in COPY FROM caused by 9f8377f7a2
List pgsql-hackers
In v16 and later, the following fails:

CREATE TABLE boom (t character varying(5) DEFAULT 'a long string');

COPY boom FROM STDIN;
ERROR:  value too long for type character varying(5)

In PostgreSQL v15 and earlier, the COPY statement succeeds.

The error is thrown in BeginCopyFrom in line 1578 (HEAD)

  defexpr = expression_planner(defexpr);

Bisecting shows that the regression was introduced by commit 9f8377f7a2,
which introduced DEFAULT values for COPY FROM.

The table definition is clearly silly, so I am not sure if that
regression is worth fixing.  On the other hand, it is not cool if
something that worked without an error in v15 starts to fail later on.

Yours,
Laurenz Albe



pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: [PoC] pg_upgrade: allow to upgrade publisher node
Next
From: Daniel Gustafsson
Date:
Subject: Re: pipe_read_line for reading arbitrary strings