Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGgW9-00052k-MV for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Nov 2024 15:33:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tGgW8-005pcT-9i for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Nov 2024 15:33:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tGgW7-005pcK-Vg for pgsql-hackers@lists.postgresql.org; Thu, 28 Nov 2024 15:33:19 +0000 Received: from mail-lj1-x230.google.com ([2a00:1450:4864:20::230]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tGgW5-0000T4-Gg for pgsql-hackers@lists.postgresql.org; Thu, 28 Nov 2024 15:33:18 +0000 Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2ffb5b131d0so8647031fa.2 for ; Thu, 28 Nov 2024 07:33:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732807996; x=1733412796; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZtD0+TBtET3aVRj3Cy8tCLXfpO/PL4+esy2KfKCTdoA=; b=K6rB9DhaU/anz+RPLvjn6HQX2gSSthT9StyIi63LU2vYVhl7uH3SScv9bc0WxcXM3i jjrnXi+S3aR7lEq3hhISQMmYLXHH92FfXyEYgRHR7LSGZwFKFFNgTdkP14wVahXjTjZc KXMHhvr+AHddENcc9NsxDA26tFmvwq3I3OFWERliqzBexHFfZ8tFoeihmqyW31Y1EWsJ aikYHKQxAs5QpSj0BT4PyKnjjlanzVX7ry4xzD10Viiji1Q9hFMQ2HwmifFEMfRQzOgS ShVSPfjmRqFGIW8SApaN7tBhcHZ0O3ali8+hrkWnj/v13oEVctvNwUSbyUOQTk0D1V4y TEbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732807996; x=1733412796; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZtD0+TBtET3aVRj3Cy8tCLXfpO/PL4+esy2KfKCTdoA=; b=RglrOpBgpZum/wPpV20nub/aC0265NY2nPc364l9rZQBR6X+cME09RFKwgb26Tpu3O Bi6ktFV+fHXmIZwS7IT6ETXxPUza9c4CkKGK2P4DgKf0gFdq6MYOptu8+o3enlMbwc+7 tBZDzKoZAF/uTvz+gvj1Zkw0bU0N2SaDX+kZqm6JLpuwjROiPpp8bnxE1NqrUdX04NnT lC08E4St2pHIzcOEUef3txa4LIaN6E6bs0HXyPhSB5W4mzVCRcPMBgMjZJ/+qGdIdzSa AqppOFc814WViFyVDnxnvoAqOU6UGR+1UpOAPDRkwzNswpFjwvDjAoYqlSs0aB4CJIq1 SrwA== X-Forwarded-Encrypted: i=1; AJvYcCW54TNMoBANRAaijDWJ0el5xJdkohe0as70p7jss+yKURZZCbBZJlbsrs6PUWQ/FIeIATU/RUv5gikIhGb2@lists.postgresql.org X-Gm-Message-State: AOJu0YwDJrjhHK8Ac/tOVbsxg7IEIRZl6PwLGek+22jXLNwl+JcA7Fe5 foAnxmwyy7axydSv14ij21R+UynLSPTnMJj+dnsnH8X2fKVDWKUN6KsaqV1VEV/fI8cfyF0pal+ XIYIyuG8TdILZPloFX5LHKTnLvuU= X-Gm-Gg: ASbGncvO3kUwU6QSKLdDBRIeAtsK05uBeC2oMUACSNjW9Wa+G3opWJ/JPMMq2FjUn0g KCTAm2ElW9MgTeLziYGhtxQwtfs05 X-Google-Smtp-Source: AGHT+IHAe4MU+3I+PBtwJSKgZi8Aa2RxtRzhnnzx0N9jahlpQV4atWzW+aofk93QtBF2maYoKIVzLj8Dd+cYm66Lg6E= X-Received: by 2002:a2e:bd04:0:b0:2ff:ce49:111e with SMTP id 38308e7fff4ca-2ffd60fad19mr26634961fa.39.1732807995527; Thu, 28 Nov 2024 07:33:15 -0800 (PST) MIME-Version: 1.0 References: <04bf425ad1b15a4daefe96c478a5253b@oss.nttdata.com> <20240206191937.72eaf0ccc20cfea37944b422@sraoss.co.jp> <76da9fcc-93c5-4053-872e-12932a95356d@uni-muenster.de> <6eac5b45-7f45-4c7a-aae1-e90db8be2e08@uni-muenster.de> <3d6b5885-16a1-475d-b56f-41701c48d9d4@uni-muenster.de> <63595e8f-a245-4335-aa22-7e449a70e210@oss.nttdata.com> <07587c36-18b3-4ccb-b5fb-579bcb04ed37@oss.nttdata.com> In-Reply-To: From: Kirill Reshke Date: Thu, 28 Nov 2024 20:33:04 +0500 Message-ID: Subject: Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row To: jian he Cc: Fujii Masao , Jim Jones , "David G. Johnston" , Yugo NAGATA , torikoshia , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 19 Nov 2024 at 13:52, jian he wrote: > > On Sat, Nov 16, 2024 at 5:55=E2=80=AFPM Kirill Reshke wrote: > > > > I am attaching my v8 for reference. > > > > in your v8. > > > REJECT_LIMIT > > > Specifies the maximum number of errors tolerated while converting a > column's input value to its data type, when ON_ERROR is > set to ignore. > If the input contains more erroneous rows than the specified > value, the COPY > command fails, even with ON_ERROR set to > ignore. > > > > > then above description not meet with following example, (i think) > > create table t(a int not null); > COPY t FROM STDIN WITH (on_error set_to_null, reject_limit 2); > 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. > >> a > >> \. > ERROR: null value in column "a" of relation "t" violates not-null constr= aint > DETAIL: Failing row contains (null). > CONTEXT: COPY t, line 1, column a: "a" > > Overall, I think > making the domain not-null align with column level not-null would be a > good thing. > > > > Specifies how to behave when encountering an error converting a col= umn's > input value into its data type. > An error_action valu= e of > stop means fail the command, > ignore means discard the input row and > continue with the next one, and > set_to_null means replace columns containing > erroneous input values with null and move to the > next row. > > "and move to the next row" is wrong? > I think it should be " and move to the next field". Hi! There is not too much time left in this CF, so I moved to the next one. If you are going to work on this patch, I'm waiting on your feedback or a v9 patch that answers the issues brought up in this discussion. --=20 Best regards, Kirill Reshke