Re: Better testing coverage and unified coding for plpgsql loops - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Better testing coverage and unified coding for plpgsql loops
Date
Msg-id 31838.1514905690@sss.pgh.pa.us
Whole thread Raw
In response to Re: Better testing coverage and unified coding for plpgsql loops  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Responses Re: Better testing coverage and unified coding for plpgsql loops
List pgsql-hackers
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Darafei "Komяpa" Praliaskouski wrote:
>> - can this macro become a function?

> The "exit_action" argument makes it tough.  It can probably be done --
> it seems to require contorting the one callsite that uses "goto" though.

It could be converted into a function returning bool, a la

    if (!loop_rc_processing(...))
        break;

but then the burden is on you to show there's negligible performance
impact, a question that doesn't arise when just macro-izing existing
code.  I suppose the function could be made inline, but then we're
right back to the question of how well lcov will display the actual
code coverage.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: PATCH: logical_work_mem and logical streaming of largein-progress transactions
Next
From: Shubham Barai
Date:
Subject: Re: [HACKERS] GSoC 2017: weekly progress reports (week 6)