Open photz opened 2 years ago
Actually, the domain name is conditionally wrapped in quotation marks:
https://github.com/postgres/postgres/blob/27b77ecf9f4d5be211900eda54d8155ada50d696/src/backend/utils/adt/domains.c#L184
format_type_be()
quotes it, if there's whitespace, for example.
Currently,
constraintViolation
does not correcty parse the error message generated by Postgres when a check constraint on a domain is violated. So, for instance, if I define a domain like this:and then do something to violate the constraint, like so
then the error message generated by Postgres is:
value for domain foo violates check constraint "foo_check"
constraintViolation
in that case returnsNothing
because it expected the domain name to be surrounded by quotation marks.