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 1hQZQL-0006jd-Gj for pgsql-hackers@arkaria.postgresql.org; Tue, 14 May 2019 15:33:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hQZQK-0006B7-8O for pgsql-hackers@arkaria.postgresql.org; Tue, 14 May 2019 15:33:00 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQZQJ-0006AV-QD for pgsql-hackers@lists.postgresql.org; Tue, 14 May 2019 15:33:00 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hQZQH-0008VH-5Q for pgsql-hackers@lists.postgresql.org; Tue, 14 May 2019 15:32:58 +0000 Received: by mail-qk1-x743.google.com with SMTP id n68so7965086qka.1 for ; Tue, 14 May 2019 08:32:57 -0700 (PDT) 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=1BPtYjqOV9BPHDIrrWZQDAwIgvcWiA6gwXzZkUnQQHg=; b=xTt2qfYMxTIwp5CUdcF/G8rfP4G+q28BNzDplV27Pv+vEU4HAymtcwG+aOCD1pbn5y Eb7x4SYUjDH0WNvFdW7gMtL9Tec99LvLCWHR66Wv6SC+B8KQI3+Bo3YlSjpeQvIXMd8L XKa1oqyd1E5PAXe20SMvY4xsW+78vJL0ZENuaTASrW7jQDGvdVqvKwy5eL5Kcl7cDKhV id+Fc32RxSKkVGj0qUao81R1h5kAFBJ90E88/2Sg9rAoUVYRZmaqIJ2QAy4ITSsNXxUM mdMAkVSkfjS5IYFnpJ7SRGFz85CzM5KdO068tIYvsuyx1Sz9qXvnnQOsnN/fMw2kLqPd bKaw== 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=1BPtYjqOV9BPHDIrrWZQDAwIgvcWiA6gwXzZkUnQQHg=; b=Vv+pFMeVX8pNaNErZ0qe0KtUI23cqOb+sSc/++Zb+x9PCZZOKybO1ZHDS32jeiNzPV 37jLXGatZ9T+9ZXMaYuLsX65jYFGhB0CuCZqCxgs3yMlcy7Sd1d7uMYEZh3zZhqAkkoY yWfRxM1NAgpVIWseCnAw8tVIUpv67qF1Rcfq8ngGCs6G/m5OESqzSZLU/UnUYYaC8SpJ Rn7rBlFjKY0hFWNk1p8SvAFCQiUuFYDjbrt5q8/7tsYp4pB9wJyx6sNutA5VeuE1fco6 4fTgilenDO3m3D2Casiju6URCG2h/WjeKXYeDRybem1p52ingYfgvW4SGH+kob2j8BTL Mmvw== X-Gm-Message-State: APjAAAWoib2UE+XgHPrzENwyNUSZ2P6mZbxY2glIBQT9h1CPDZvgBlQE RMpmSXhBVVBITc7fzSBEZ/3I1XANmjySNy/RMmwNbLLFHomzXPmDHbqvE/lQ6/5Az9E8clHmRiT UZkyJh+gJkADjXTGr1Au8NKfn6NvOKzzkIIcA+2+/DIVaUSh0E9xIziMzC7bISiGkeVTaLHiFA2 qOz3AzX2kHnnuC8g== X-Google-Smtp-Source: APXvYqxvOFaVT+g63oAkXdAnI3nv7GSaXBQUhDNj7OPoRgIUShbOoffsPRqP5NosiUXr1cRKmV+XHg== X-Received: by 2002:a37:dc03:: with SMTP id v3mr28851824qki.151.1557847975830; Tue, 14 May 2019 08:32:55 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id c18sm8635421qkl.78.2019.05.14.08.32.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 08:32:54 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id DE54F12097D; Tue, 14 May 2019 11:32:52 -0400 (-04) Date: Tue, 14 May 2019 11:32:52 -0400 From: Alvaro Herrera To: Michael Paquier Cc: Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: Inconsistent error message wording for REINDEX CONCURRENTLY Message-ID: <20190514153252.GA22168@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190509041154.GC14573@paquier.xyz> 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-May-09, Michael Paquier wrote: > On Wed, May 08, 2019 at 11:28:35PM -0400, Tom Lane wrote: > > Michael Paquier writes: > >> No problem to do that. I'll brush up all that once you commit the > >> first piece you have come up with, and reuse the new API of catalog.c > >> you are introducing based on the table OID. > > > > Pushed my stuff, have at it. > > Thanks. Attached is what I get to after scanning the error messages > in indexcmds.c and index.c. Perhaps you have more comments about it? I do :-) There are a couple of "is not supported" messages that are annoyingly similar but different: git grep --show-function 'reindex.*supported' -- *.c src/backend/commands/indexcmds.c=ReindexMultipleTables(const char *objectName, ReindexObjectType objectKind, src/backend/commands/indexcmds.c: errmsg("concurrent reindex of system catalogs is not supported"))); src/backend/commands/indexcmds.c: errmsg("concurrent reindex is not supported for catalog relations, skipping all"))); src/backend/commands/indexcmds.c=ReindexRelationConcurrently(Oid relationOid, int options) src/backend/commands/indexcmds.c: errmsg("concurrent reindex is not supported for shared relations"))); src/backend/commands/indexcmds.c: errmsg("concurrent reindex is not supported for catalog relations"))); It seems strange to have some cases say "cannot do foo" and other cases say "foo is not supported". However, I think having ReindexMultipleTables say "cannot reindex a system catalog" would be slightly wrong (since we're not reindexing one but many) -- so it would have to be "cannot reindex system catalogs". And in order to avoid having two messages that are essentially identical except in number, I propose to change the others to use the plural too. So the one you just committed > + /* A system catalog cannot be reindexed concurrently */ > + if (IsCatalogRelationOid(relationOid)) > + ereport(ERROR, > + (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), > + errmsg("cannot reindex a system catalog concurrently"))); would become "cannot reindex system catalogs concurrently", identical to the one in ReindexMultipleTables. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services