Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gz6xb-0007Zh-E8 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Feb 2019 21:41:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gz6xa-00012L-68 for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Feb 2019 21:41:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gz6xZ-00012E-SN for pgsql-hackers@lists.postgresql.org; Wed, 27 Feb 2019 21:41:50 +0000 Received: from mail-qt1-x82f.google.com ([2607:f8b0:4864:20::82f]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gz6xX-00047a-10 for pgsql-hackers@lists.postgresql.org; Wed, 27 Feb 2019 21:41:49 +0000 Received: by mail-qt1-x82f.google.com with SMTP id d18so21066448qtg.12 for ; Wed, 27 Feb 2019 13:41:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=UIgVcMteazgLtTD4xDLQf5vdGy9xkIQt59w8Ht9OuOE=; b=bLEsoN47/NcerQR9dyMe2bkhH2NlBmB1JFHrzszmy4Xf0KX5y1J2YGdu3fVbljng6J bnkgv5UxWjgwAyvB1ODrNNwYdHlxB86ofhCE8d1RXpD/h6bhJjZsqArPhNX1q/oUPFwd Wx6lC1T4MglyX8NV0jMMzwaHrLlOYRJWjT1UYvz96WlqUxDRMWFKz8mxwOkyTCxxzROO Q81Y6fPu0GthgXXqgcBO043aY+OR79S10OCnNehlhbOfiUo9wG+FeJyvwFbkzpqiEeV/ B/X/LAApUrPWzqZARXU8/rzCnvRSRW3coQOisZJUtu3+VGg9WXTWRcdfiTvxGbp6j+uv m9aQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=UIgVcMteazgLtTD4xDLQf5vdGy9xkIQt59w8Ht9OuOE=; b=ns0b0A/pljntkzWuuykVTXTdpAPGfaM7YHPI9q5fvEW1ujDIv2sAQS1BcLuBn7CYaG rdnegY22WUrEsT77F4BtNhqQCYqDOrNT32Wjnqpd8K3xi4rMICi4R9tWH6wDC0A59VKl wnkFwiklkasoV0DOxS5L/mYYFV/yIeZRZgAuJbEU5IEHB+aCQoI1upqifKNCcci0uqWA 1UbzVjHWErNrly+RWtRTuuMS58264NwHCNSA0sphzpVOMd0fFwHtFcXx61tVUxW88F0h Cgn2ToGAvw1xhbRY5g9egn2fHEAVmBBHtZBGhdTTHdCYfSfacWpl2c/KJ9azbfGQTi2l Mfkg== X-Gm-Message-State: APjAAAXLWWwNeoM99w89lGfuiLcdjNV9yc3hk5EsliW7djAe7JlozeCM yDbrCqbz3C/OCqAvAmJCtDr4gA== X-Google-Smtp-Source: APXvYqwvmquUL/JiYeNYz/d+KFK0HmtAzq7hfJHfi8ygy08ihTUlH6Wr2yC4GExZHk2xdFCnPfvo/w== X-Received: by 2002:a0c:95dd:: with SMTP id t29mr3776363qvt.174.1551303704645; Wed, 27 Feb 2019 13:41:44 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([191.126.99.65]) by smtp.gmail.com with ESMTPSA id i1sm10085530qtb.0.2019.02.27.13.41.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 27 Feb 2019 13:41:44 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 8EF2012475F; Wed, 27 Feb 2019 18:41:37 -0300 (-03) Date: Wed, 27 Feb 2019 18:41:37 -0300 From: Alvaro Herrera To: Tom Lane Cc: Andres Freund , pgsql-hackers@lists.postgresql.org Subject: Re: POC: converting Lists into arrays Message-ID: <20190227214137.GA20958@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <10893.1551299206@sss.pgh.pa.us> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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