[PATCH] Add tests for integrity violation error fields - Mailing list pgsql-hackers

From Chris Bandy
Subject [PATCH] Add tests for integrity violation error fields
Date
Msg-id 0731def8-978e-0285-04ee-582762729b38@gmail.com
Whole thread Raw
In response to Re: [PATCH] Add object names to partition errors  (Chris Bandy <bandy.chris@gmail.com>)
List pgsql-hackers
On 3/4/20 2:54 AM, Chris Bandy wrote:
> I've also convinced myself that the number of integrity errors in the
> entire codebase is manageable to test. If others think it is worthwhile,
> I can spend some time over the next week to expand this test approach to
> cover _all_ SQLSTATE class 23 errors.

Done. Please find attached two patches that (1) test all but one reports
of integrity violations and (2) attach object names to the handful that
lacked them.

I decided to include error messages in the tests so that the next person
to change the message would be mindful of the attached fields and vice
versa. I thought these might be impacted by locale, but `make check
LANG=de_DE.utf8` passes for me. Is that command the right way to verify
that?

With these patches, behavior matches the documentation which states:
"[object] names are supplied in separate fields of the error report
message so that applications need not try to extract them from the
possibly-localized human-readable text of the message. As of PostgreSQL
9.3, complete coverage for this feature exists only for errors in
SQLSTATE class 23..."


Thanks,
Chris

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: More tests to stress directly checksum_impl.h
Next
From: Amit Kapila
Date:
Subject: Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager