Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Errors on domain checks with missing, incomplete tracebacks

5 views
Skip to first unread message

johnfr...@gmail.com

unread,
Mar 16, 2018, 6:19:23 PM3/16/18
to
Today I realized a number of points where PG is rather lackluster and sparse in its error messages.

I've created a gist:

https://gist.github.com/loveencounterflow/ce623d2905535c9e2dcbc0111e35aa9e

to make it easy to review my assertions made there.

Basically, what it boils down to is 2 points:

* I can define a constraint with a check that uses an illegal
RegEx to match values; this will remain undetected until I
actually insert rows that trigger the check. No reference
to the location or the literal value of the illegal expression
is given.

The important thing to understand here is that it is not the
constraint or the match that fails; rather, I accidentally
managed to smuggle syntactically invalid material into
a table definition. I can even select from that table without
any problems being detected!

* With a (named) table with a (named) constraint to check against
a (named) domain and an insert that violates that constraint,
I get an error message with the approximate line number of the
problematic insert statement, but no reference to the offending
piece of data, no reference to the name of the offended constraint,
and no reference to the involved table.

Hopefully it won't be too difficult to do something about these problems?
0 new messages