From: Tom Lane <tgl@sss.pgh.pa.us>
To: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix progress reporting of CLUSTER / VACUUM FULL
Date: Fri, 13 Sep 2019 14:47:56 -0400
Message-ID: <19795.1568400476@sss.pgh.pa.us> (raw)
In-Reply-To: <E1i8pqS-0003NN-7p@gemulon.postgresql.org>
References: <E1i8pqS-0003NN-7p@gemulon.postgresql.org>
Alvaro Herrera <alvherre@alvh.no-ip.org> writes:
> Fix progress reporting of CLUSTER / VACUUM FULL
Not a new problem of this patch, exactly, but:
/* Reindex options */
#define REINDEXOPT_VERBOSE 1 << 0 /* print progress info */
+#define REINDEXOPT_REPORT_PROGRESS 1 << 1 /* report pgstat progress */
Surely these macro definitions are incredibly dangerous due to their
lack of parentheses.
I'd initially thought that we already had bugs in existing usages like
if (options & REINDEXOPT_VERBOSE)
After consulting a nearby C reference I see that we're accidentally
saved by << having higher priority than &, but this is not safely-
maintainable code. Expressions like "~REINDEXOPT_VERBOSE" would not
do what one expects.
regards, tom lane
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-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us, alvherre@alvh.no-ip.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Fix progress reporting of CLUSTER / VACUUM FULL
In-Reply-To: <19795.1568400476@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