Re: [PATCH] Add object names to partition errors - Mailing list pgsql-hackers

From Chris Bandy
Subject Re: [PATCH] Add object names to partition errors
Date
Msg-id 7985cf2f-5082-22d9-1bb4-6b280150eeae@gmail.com
Whole thread Raw
In response to Re: [PATCH] Add schema and table names to partition error  (Chris Bandy <bandy.chris@gmail.com>)
Responses [PATCH] Add tests for integrity violation error fields  (Chris Bandy <bandy.chris@gmail.com>)
List pgsql-hackers
On 3/3/20 11:18 PM, Chris Bandy wrote:
> On 3/3/20 10:08 AM, Alvaro Herrera wrote:
>> I don't suppose you mean to
>> test that every single ereport() call that includes errtable() contains
>> a TABLE NAME item.
> 
> Correct. I intend only to test the few calls I'm touching in this
> It might be worthwhile for someone to perform a more thorough
> review of existing errors, however. The documentation seems to say that
> every error in SQLSTATE class 23 has one of these fields filled[1]. The
> errors in these patches are in that class but lacked any fields.
> 
> [1] https://www.postgresql.org/docs/current/errcodes-appendix.html

By the power of grep I found another partition error that needed a
field.  I'm pretty happy with the way the test turned out, so I've
squashed everything into a single patch.

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.

If so,

* Should it be one regression test (file) that discusses the
significance of class 23, or

* Should it be a few test cases added to the existing test files related
to each feature?

The former allows the helper function to be defined once, while the
latter would repeat it over many files.

Thanks,
Chris

Attachment

pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: reindex concurrently and two toast indexes
Next
From: John Naylor
Date:
Subject: Re: Use compiler intrinsics for bit ops in hash