pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Check constraint failure messages
Date: Tue, 6 Apr 2021 15:03:25 -0500
Message-ID: <ead34fe3-3a92-6875-6081-d1e4fb665478@gmail.com> (raw)
In-Reply-To: <CAALojA9P+Ci-5ojrzDQZqpaJqL4XzKOB+DHRraME0cbSzM+7Vw@mail.gmail.com>
References: <CAALojA9P+Ci-5ojrzDQZqpaJqL4XzKOB+DHRraME0cbSzM+7Vw@mail.gmail.com>

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.

view thread (9+ messages)  latest in thread

Message-ID: <ead34fe3-3a92-6875-6081-d1e4fb665478@gmail.com>
Permalink:  ../ead34fe3-3a92-6875-6081-d1e4fb665478@gmail.com/
Also on:    postgresql.org/message-id/ead34fe3-3a92-6875-6081-d1e4fb665478@gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: Check constraint failure messages
  In-Reply-To: <ead34fe3-3a92-6875-6081-d1e4fb665478@gmail.com>
  References: <CAALojA9P+Ci-5ojrzDQZqpaJqL4XzKOB+DHRraME0cbSzM+7Vw@mail.gmail.com> <ead34fe3-3a92-6875-6081-d1e4fb665478@gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox