pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: Darafei "Komяpa" Praliaskouski <me@komzpa.net>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Better testing coverage and unified coding for plpgsql loops
Date: Tue, 02 Jan 2018 10:08:10 -0500
Message-ID: <31838.1514905690@sss.pgh.pa.us> (raw)
In-Reply-To: <20180102134623.4mhrbnc2im6bfp7a@alvherre.pgsql>
References: <20180102134623.4mhrbnc2im6bfp7a@alvherre.pgsql>

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




view thread (12+ messages)  latest in thread

Message-ID: <31838.1514905690@sss.pgh.pa.us>
Permalink:  ../31838.1514905690@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/31838.1514905690@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, me@komzpa.net, pgsql-hackers@lists.postgresql.org
  Subject: Re: Better testing coverage and unified coding for plpgsql loops
  In-Reply-To: <31838.1514905690@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox