Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lTrvA-0006K5-Fy for pgsql-general@arkaria.postgresql.org; Tue, 06 Apr 2021 20:03:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lTrv9-0000dE-FJ for pgsql-general@arkaria.postgresql.org; Tue, 06 Apr 2021 20:03:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lTrv9-0000d7-53 for pgsql-general@lists.postgresql.org; Tue, 06 Apr 2021 20:03:31 +0000 Received: from mail-ot1-x330.google.com ([2607:f8b0:4864:20::330]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lTrv6-000294-Tz for pgsql-general@lists.postgresql.org; Tue, 06 Apr 2021 20:03:30 +0000 Received: by mail-ot1-x330.google.com with SMTP id v24-20020a9d69d80000b02901b9aec33371so15859212oto.2 for ; Tue, 06 Apr 2021 13:03:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language; bh=mwOKixxl832yCK3yN4n0K0DltfzlgkY4ClikVJrSW9o=; b=SD+MeLTNGLxsG5hvPOQ9ZBRHsTnyJpKeiJ3ALH4y9OnByKb9VMl1ilA30dfvhCed3k VzgaSxvhoHtDYy1Q7ZC3eGgIbedkyy2WglbIR8EhiNvcqe3MUVau3zjlKCdFQ20V82Mq SCQTck0C62F2WmLpa5ksQP6sN+ooYep3v4JcbxAeym4Rt288RYCXBNXk08F60hX7xAFy 0FYnVnIQ1WRNEce64v1oV0KCGmSOgOiWwisSWhLi0ehlRbj9japDe74M8muaMtshTuus fkqrFI25nFu2fLjvs7ppKfwlgy76LJ87so+J0fmVYCoikoD1ruKxOp6nt8o5UxFbP60a RSCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=mwOKixxl832yCK3yN4n0K0DltfzlgkY4ClikVJrSW9o=; b=FokuTds2zuRCbRi1f7ayE8ACA5337ufnIIF+NWHXYBs5gHHe4cPMNV5iG9GDHE1rkx g8zTt9Ws5qHlC9F20e5kzU/dtY0N7RDQhKHYudjn1Jyu0zSXOrKt7EjbMuoa/8JARNaS 3ZN4Wzg0XxmWJKxbuRVMF+8+i+2WxiPHLxtIjU7Sw0seCpisSbBqaoyBYGa5fLnFesZQ J6NCs0Le/q/0HwDHO8vIDfX3PRe9Gzgs1fS0856gkwrdomp7/VwqYXOZUCZpe8eDwPzf 2Th65Bg9Ma2vj0cg6Fpf3oG4p9+TW2Fz1lhgUmwzM0PCuuhAe+s6Gdh41r4gkLYxk7Zk b8TQ== X-Gm-Message-State: AOAM530LYEwb+7qhk0xThybUqDFKgqPlJG1viXgVi0Z+FUb9PEOntDyJ Y1tS8yTnACvqj4Dta0QdhgD4ciDjiDw= X-Google-Smtp-Source: ABdhPJzA45Q7ArVDCsbHSQxXImly/d9WHLlKZzGM84hPfp5UPiCoI7I6EYlZUAqAy7JDWWB26HaflQ== X-Received: by 2002:a9d:5614:: with SMTP id e20mr27523769oti.304.1617739407507; Tue, 06 Apr 2021 13:03:27 -0700 (PDT) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id h59sm4868354otb.29.2021.04.06.13.03.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 06 Apr 2021 13:03:26 -0700 (PDT) Subject: Re: Check constraint failure messages To: pgsql-general@lists.postgresql.org References: From: Ron Message-ID: Date: Tue, 6 Apr 2021 15:03:25 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/alternative; boundary="------------B051B60939B559D3EA9B947C" Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------B051B60939B559D3EA9B947C Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 4/6/21 2:40 PM, Miles Elam wrote: > I've got a domain that validates email addresses. When inserting a bunch > of entries I simply get the error message > > ERROR: value for domain po.email violates check constraint > "email_check" SQL state: 23514 > > > When inserting 1000+ entries in a batch, finding the exact entry with the > problem is noticeably harder than with other error types. For example when > a column should be a uuid but you pass in 'Mary had a little lamb', the > error message tells you what the invalid value is as well as the column > name you're trying to put it into. > > Are there any quick hacks floating around out there to solve or at least > mitigate this? Is it a deferred constraint? -- Angular momentum makes the world go 'round. --------------B051B60939B559D3EA9B947C Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit On 4/6/21 2:40 PM, Miles Elam wrote:
I've got a domain that validates email addresses. When inserting a bunch of entries I simply get the error message

ERROR: value for domain po.email violates check constraint "email_check" SQL state: 23514

When inserting 1000+ entries in a batch, finding the exact entry with the problem is noticeably harder than with other error types. For example when a column should be a uuid but you pass in 'Mary had a little lamb', the error message tells you what the invalid value is as well as the column name you're trying to put it into.

Are there any quick hacks floating around out there to solve or at least mitigate this?

Is it a deferred constraint?

--
Angular momentum makes the world go 'round.
--------------B051B60939B559D3EA9B947C--