Re: Domain Constraint Violation Error Messages - Mailing list pgsql-bugs

From Benjamin Coutu
Subject Re: Domain Constraint Violation Error Messages
Date
Msg-id 20180725155145.BCBFB5FB09@mx.zeyos.com
Whole thread Raw
In response to Domain Constraint Violation Error Messages  (Benjamin Coutu <ben.coutu@zeyos.com>)
Responses Re: Domain Constraint Violation Error Messages
List pgsql-bugs
> postgres[15271][1]=# \set VERBOSITY verbose
> postgres[15271][1]=# INSERT INTO myusers (name, email, token) VALUES('', 'b', 'x');
> ERROR:  23514: value for domain t_txt violates check constraint "dc_txt"
> SCHEMA NAME:  public
> DATATYPE NAME:  t_txt
> CONSTRAINT NAME:  dc_txt
> LOCATION:  ExecEvalConstraintCheck, execExprInterp.c:3521
> Time: 0.503 ms
>
> That seems to address most of your complaint? Unfortunately the column
> name is not available, as check constraints can involve more than one
> column.
>

Well, the problem is that the underlying column is not referenced, and neither is the table. That's the issue right
there.

Also, I'm aware that regular table constraints can reference multiple columns. But it is my understanding that check
constrainton domains may only always refer to one column (through VALUE), right? In any case it would be useful to at
leastdisplay the underlying table name. 

In general, I understand that it is not trivial given the generic/unified use of constraints whether it's column
constraints,table constraints or domain constraints. I'm not giving up hope though, that the column info can be
propagatedat least for single column constraints and more importantly for domain constraints. 


pgsql-bugs by date:

Previous
From: Ze Victor Harry
Date:
Subject: Re: mvn package not installing/error
Next
From: Andres Freund
Date:
Subject: Re: Domain Constraint Violation Error Messages