On 12.09.24 12:13, jian he wrote:
> please check the attached file.
v4 applies cleanly, it works as expected, and all tests pass.
postgres=# \pset null '(NULL)'
Null display is "(NULL)".
postgres=# CREATE TEMPORARY TABLE t2 (a int, b int);
CREATE TABLE
postgres=# COPY t2 (a,b) FROM STDIN WITH (on_error set_to_null, format csv);
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself, or an EOF signal.
>> 1,a
>> 2,1
>> 3,2
>> 4,b
>> a,c
>> \.
COPY 5
postgres=# SELECT * FROM t2;
a | b
--------+--------
1 | (NULL)
2 | 1
3 | 2
4 | (NULL)
(NULL) | (NULL)
(5 rows)
Perhaps small changes in the docs:
<literal>set_to_null</literal> means the input value will set to
<literal>null</literal> and continue with the next one.
"will set" -> "will be set"
"and continue with" -> "and will continue with"
Other than that, LGTM.
Thanks!
--
Jim