On 1/28/13 11:08 PM, Tom Lane wrote:
> The issue is that
> this definition presupposes that we want to complain about a table or
> a domain, never both, because we're overloading both the SCHEMA_NAME
> and CONSTRAINT_NAME fields for both purposes. This is annoying in
> validateDomainConstraint(), where we know the domain constraint that
> we're complaining about and also the table/column containing the bad
> value. We can't fill in both TABLE_NAME and DATATYPE_NAME because
> they both want to set SCHEMA_NAME, and perhaps not to the same value.
I think any error should only complain about one object, in this case
the domain. The table, in this case, is more like a context stack item.