On 2020-01-16 13:56, Robert Haas wrote:
> On Thu, Jan 16, 2020 at 12:50 AM Michael Paquier <michael@paquier.xyz> wrote:
>> Thanks, that looks fine. I am still not sure whether the second patch
>> adding an enum via ProcWaitStatus improves the code readability
>> though, so my take would be to discard it for now. Perhaps others
>> think differently, I don't know.
>
> IMHO, custom enums for each particular case would be a big improvement
> over supposedly-generic STATUS codes. It makes it clearer which values
> are possible in each code path, and it comes out nicer in the
> debugger, too.
Given this feedback, I would like to re-propose the original patch,
attached again here.
After this, the use of the remaining STATUS_* symbols will be contained
to the frontend and backend libpq code, so it'll be more coherent.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services