[PATCH] Add tests for integrity violation error fields

From: Chris Bandy <bandy(dot)chris(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Subject: [PATCH] Add tests for integrity violation error fields
Date: 2020-03-07 05:37:37
Message-ID: 0731def8-978e-0285-04ee-582762729b38@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
v5-0001-Add-tests-for-integrity-violation-error-fields.patch text/x-patch 20.2 KB
v5-0002-Add-object-names-to-partition-integrity-violations.patch text/x-patch 6.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2020-03-07 05:44:40 Re: [HACKERS] Moving relation extension locks out of heavyweight lock manager
Previous Message Michael Paquier 2020-03-07 05:06:30 Re: More tests to stress directly checksum_impl.h