On 2019-Feb-27, Tom Lane wrote:
> I'm particularly unsure about whether we need two macros; though the
> way I initially tried it with just list_cell_is_last() seemed kind of
> double-negatively confusing in the places where the test needs to be
> not-last. Also, are these macro names too long, and if so what would
> be better?
I think "!list_cell_is_last()" is just as readable, if not more, than
the "is_not_last" locution:
appendStringInfoChar(&buf, '\'');
if (!list_cell_is_last(l))
appendStringInfoString(&buf, ", ");
I'd go with a single macro.
+1 for backpatching the new macros, too. I suspect extension authors
are going to need to provide compatibility versions anyway, to be
compilable against older minors.
--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services