Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita189ed4

Browse files
committed
Add tests for more row patterns with COPY FROM .. (ON_ERROR ignore)
While digging into the code of this feature, I got confused by the factthat a line is skipped when a value cannot be converted to its expectedattribute even if the line has fewer attributes than the targetrelation. The tests had a check for the case of an empty line, thiscommit a couple more patterns where a line is incomplete, but skippedbecause of a conversion error.Reviewed-by: Bharath RupireddyDiscussion:https://postgr.es/m/Ze_7kZqexdt0BiyC@paquier.xyz
1 parent0b84f5c commita189ed4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎src/test/regress/expected/copy2.out

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -730,13 +730,14 @@ COPY check_ign_err FROM STDIN WITH (on_error stop);
730730
ERROR: invalid input syntax for type integer: "a"
731731
CONTEXT: COPY check_ign_err, line 2, column n: "a"
732732
COPY check_ign_err FROM STDIN WITH (on_error ignore);
733-
NOTICE:4 rows were skipped due to data type incompatibility
733+
NOTICE:6 rows were skipped due to data type incompatibility
734734
SELECT * FROM check_ign_err;
735735
n | m | k
736736
---+-----+---
737737
1 | {1} | 1
738738
5 | {5} | 5
739-
(2 rows)
739+
8 | {8} | 8
740+
(3 rows)
740741

741742
-- test datatype error that can't be handled as soft: should fail
742743
CREATE TABLE hard_err(foo widget);

‎src/test/regress/sql/copy2.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,9 @@ a{2}2
515515
4{a,4}4
516516

517517
5{5}5
518+
6a
519+
7{7}a
520+
8{8}8
518521
\.
519522
SELECT*FROM check_ign_err;
520523

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp