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 1tDJyY-00HTqJ-FI for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Nov 2024 08:52:46 +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 1tDJyV-00BbjH-Kn for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Nov 2024 08:52:44 +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 1tDJyV-00Bbj8-Am for pgsql-hackers@lists.postgresql.org; Tue, 19 Nov 2024 08:52:43 +0000 Received: from mail-vk1-xa35.google.com ([2607:f8b0:4864:20::a35]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tDJyT-002f8K-A8 for pgsql-hackers@lists.postgresql.org; Tue, 19 Nov 2024 08:52:42 +0000 Received: by mail-vk1-xa35.google.com with SMTP id 71dfb90a1353d-5146e5fad69so1827286e0c.0 for ; Tue, 19 Nov 2024 00:52:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732006360; x=1732611160; 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=lEjIbTd0EOFzMXLdijEtfsGUkHTQJ0U5ob9+6BraPjo=; b=fVDwSInjYYJnJmnIqD0vnSRTbNqFf17w6vlPubKCHRaIYWgRmhXRkDP9hvAkEPT5lm mR/O9dfnXg7QrbQjnw4XFZ+m+jrd7E2PPOzyoaVIv9f+3RdGt1z2FdSXbnXFJSHJsQQ5 MRUc7mklYUJlIaiZAxQl/l3y2JbfCwLcyka9n/Xsrn4aaSy85st+Fr/Pve8rfTz62Y7b PK3yKE7msGi8GAm19ZyScqE1BfEBfUPUvA+1Oul0CuHKpoVRcdcs4e3YYRhoRviPnb9n s6MUp9ryjYpyIQxza7zHxQLOPQLgaPXIVDMMxPbFl6k+419KKIyAkJukJpy5SQKSsS7P 6L/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732006360; x=1732611160; 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=lEjIbTd0EOFzMXLdijEtfsGUkHTQJ0U5ob9+6BraPjo=; b=PgMZpyTnuK4GeR3l1jEhteE4SYqlb0IoAnHEsnLqWygSbxK/hqCsCiFWF/wg9IhgbB LfkqmDpvPDRDbfZkWKVSO6hrABHq6lBB31wDgi2VsZWh1QWhuDhb4GVM3z3A/6WInle3 7sS5BqUSd64Top5kRU3k3tXCgZ2TfYyjHxL24+h8Te3/SWavy71nZO9VIJ2YOkupbJXI M6Nc76VpB9tBhNCQQ4PJB0nU3HvJe81IOqxeL1iveiVkOTKXMY7j1vnZmCeXQoP2qrHw GPNLnqIn4uBaoi9/ruxqQp8U9r+xVJ81jubZyYwrVGH69S/qQB5994rYNu3b3krlVItS tmEA== X-Forwarded-Encrypted: i=1; AJvYcCUgj81Q8zSxehPMuTRZ5DN+jkoMXsYYMOUAtw1Uw6q7nL/HggCwijTiJeIQz+KQEHXjFbQhewSMSaQ8Z2BB@lists.postgresql.org X-Gm-Message-State: AOJu0YwEbPIzW/W/3836s0cbu2ndkaO+o6JLPK1LYCbYTFa3RpMtoyZX zgKH6NzIr5sV7qEjXl7nHktRHYZVXK3m0zZL5vUeEVth01iTqXastIy1mJxmed8G5usSUh35Bdp AuJYLtpWkBcL5UZ+85rTw8NS6IBo= X-Google-Smtp-Source: AGHT+IF5LxNNfUIISlfhifXDNzHR2XFHpNiKPuZoa1rYp3Lsrs6nY3ReYXgBKhtCWqnjQJWlN4U1I+Ed5UCAtpGWHtY= X-Received: by 2002:a05:6122:7d3:b0:50d:8d89:9f4 with SMTP id 71dfb90a1353d-51477ebe06bmr14861276e0c.3.1732006359947; Tue, 19 Nov 2024 00:52:39 -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: jian he Date: Tue, 19 Nov 2024 16:52:28 +0800 Message-ID: Subject: Re: Change COPY ... ON_ERROR ignore to ON_ERROR ignore_row To: Kirill Reshke 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 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 constrai= nt 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 colum= n's input value into its data type. An error_action value = 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".