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 1ifUou-0005WK-Ho for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Dec 2019 20:12:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ifUnv-000762-8f for pgsql-bugs@arkaria.postgresql.org; Thu, 12 Dec 2019 20:11:19 +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 1ifUnu-00075q-Rb for pgsql-bugs@lists.postgresql.org; Thu, 12 Dec 2019 20:11:19 +0000 Received: from mail-pg1-x544.google.com ([2607:f8b0:4864:20::544]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ifUnr-0000xd-15 for pgsql-bugs@lists.postgresql.org; Thu, 12 Dec 2019 20:11:17 +0000 Received: by mail-pg1-x544.google.com with SMTP id s64so86412pgb.9 for ; Thu, 12 Dec 2019 12:11:14 -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=YFFYIKtzufxXkj0ptN8z0RVd5uEgtC7VOunHMA4ApM8=; b=vTD9jUhuLK8JiuYrr+2mtqZQuz71cPetiORuc3oecFt3joGHqsNt5q995wvsfmTIGi WDw4WpFRiJ8lb88VNvEFV+f9J67rpuP/HcDgsHA27CBBr4LMG9ZQUU/3/udT8l4Xrt75 u1jeH3HkqdC6HlKNj9/6tgjQNwaDfnW3CZkGbmUj7+YvCYTd6BrzA9cSdpBLm3YyeVyp /DlWhIy4xIc+RZwH1bytQbJ3z/tJjCGrhq4mbnSF4qHn601JML8FfRMqvrOw9tsFxPnQ YYMXbFzMOTYN2Xi4AMgFQxZ2N+b5BXLK9x35xDpIfZ3Nvgn6jnQhIWmMZog1q+DqsZ/3 Su9Q== 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=YFFYIKtzufxXkj0ptN8z0RVd5uEgtC7VOunHMA4ApM8=; b=EOWtCf2iuY2T0HqQCirSX2dGA1Ex6T2hyC9+HFW55/Jwqr+Y785uNyP/ojZpKBxwI5 Rj5bLOxLtOCFcoQ5oPXTxd2OUV1cgDzAjPjcXD+d7txFmS+oA//iSpuVG9+N8nWPyPoH Ze+LpGhWFTU7rUlFxzTWbCVNHD30+O0+Xbex3MDk8yzZ7Db7OgZRHrMpAOCYTcVCtEj3 cy9MrKg+Yop/nqUFINGccfvjLRCllvwBn//OwuNlI7qifeorwlmuoRGLKGRkmo4FQj6P GZH8BReBIW0c+v8e2hxDUhAQFJSvrqg1ra21JrS9PzjRsbYcpx6HN/J/IB3S0ZHunUEP hW2g== X-Gm-Message-State: APjAAAVV3X5w7rTHjc1HHxGl3Z/R3rWzcq/KH7cEhwHPp6BpdpL+E9TO 4+cxClrhQw71l1lbOwSeZmxkJDEWSsf7LQ== X-Google-Smtp-Source: APXvYqyIECtXCRnyAj7FCLRVW79q0fm4jXVQwrHHvLGKzvQ5oVfFwpfmLyioENVgTZmpEQ0ldRaV+A== X-Received: by 2002:a63:4416:: with SMTP id r22mr12512777pga.254.1576181472281; Thu, 12 Dec 2019 12:11:12 -0800 (PST) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id i127sm8263480pfc.55.2019.12.12.12.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Dec 2019 12:11:11 -0800 (PST) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 8BAD03008FC; Thu, 12 Dec 2019 17:11:08 -0300 (-03) Date: Thu, 12 Dec 2019 17:11:08 -0300 From: Alvaro Herrera To: Michael Paquier Cc: Andres Freund , Tom Lane , Manuel Rigger , PostgreSQL mailing lists Subject: Re: REINDEX CONCURRENTLY unexpectedly fails Message-ID: <20191212201108.GA2944@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20191120035408.GA4243@paquier.xyz> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Nov-20, Michael Paquier wrote: > diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h > index 1113d25b2d..04d3d4826f 100644 > --- a/src/include/catalog/index.h > +++ b/src/include/catalog/index.h > @@ -113,6 +113,8 @@ extern bool CompareIndexInfo(IndexInfo *info1, IndexInfo *info2, > > extern void BuildSpeculativeIndexInfo(Relation index, IndexInfo *ii); > > +extern bool RelationSupportsConcurrently(char relpersistence); > + > extern void FormIndexDatum(IndexInfo *indexInfo, > TupleTableSlot *slot, > EState *estate, I liked Andres' original naming suggestion better FWIW. With this, one wonders "concurrently what?" > +/* > + * RelationSupportsConcurrently > + * > + * Check if a relation supports concurrent builds or not. This is > + * used as a sanity check prior processing CREATE INDEX, DROP INDEX > + * or REINDEX when using CONCURRENTLY. > + */ Some suggestions, "RelationSupportsConcurrentIndexing" or "IndexSupportsConcurrently". Maybe replace the "ing" in the first or "ly" in the second with "DDL" or "Ops". (Also, if it's just about indexes and appears in index.h, why did you use the prefix "Relation"?) In the indexcmds.c Reindex* routines, why not turn off the "concurrent" flag? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services