Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiLi4-0001Yw-3y for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Jun 2020 17:37:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jiLi3-0001EZ-0h for pgsql-bugs@arkaria.postgresql.org; Mon, 08 Jun 2020 17:37:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jiLi2-0001Dr-QV for pgsql-bugs@lists.postgresql.org; Mon, 08 Jun 2020 17:37:18 +0000 Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jiLhv-000182-Ei for pgsql-bugs@lists.postgresql.org; Mon, 08 Jun 2020 17:37:18 +0000 Received: by mail-qt1-x843.google.com with SMTP id w9so15377436qtv.3 for ; Mon, 08 Jun 2020 10:37:10 -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=EVe7jzlHPlvsaXB6iGEF7SGd5/1PKse4dMZhLemY26Y=; b=oDlg0TOhAzLy44ciX8lTdPPXSiqcziUyA71yp7DdEuaA46r8uKSFc8x5wwYyyJH2Vg hOPnvkm46MntKR8OPBsoFCkoZHk49PTy9ibcn0MXSwudBZpgCo/TvT5OjpQp3mgq8CkN ra5ZwFYH33caqs2+EQEIozCFHe3dO7XA9d0ZCgLtVy2hrxdzfo82bKWHXW3laZWxvvZS A88KiXyzh0x06GhVdhlzMYcD9TT3eMhvsE7AAneHUwSBSCJ0rMSpYdwesihjp4ooKGM9 wctMaoIRUruJFQzH6+FeqewvSVFg3aFsJHaL6V94M0Vv+dlgNY/gq8kp0h7NQE/tQAQ2 g4gA== 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=EVe7jzlHPlvsaXB6iGEF7SGd5/1PKse4dMZhLemY26Y=; b=YLuVSX8KNdOUWk7qnCCegllrN+sGYww62/zh+OAr+VZIcnKRLeFy4svdugwDDyLRo0 qo/72gACp6+PYidJucoqpApT23fiJKCiNJgvCYHLNQ6ClvA5rqdG3L5pCIKyZOuaQ3fL cPZ9l3L6wNd0lLfXFZkT1NV+dFd98W6R6FRLB51ji1l77v4yKmESR8uTn9tTjbg9Dfr7 CMqWnjXK42ufsHUFY1l/y7nkZdRhbLMGSHbAwC9P0uBS0nGSC+/qlpb7EG+Bg5j/LbGH rjjhQpSjVsYsDqA88JD26t+Fr9ZQ4FMpi9vBbNqb39pyc+DY7MiR06uuOLK4k2F/iblI SjzA== X-Gm-Message-State: AOAM530k/BgQR0qXs4AlZdT8nH/WfvSJVzOiRp4zDQjCUjPVEYBLgwwD scOil0Aq171sYoTc/IpPvPzUIQ== X-Google-Smtp-Source: ABdhPJzNgYquv4K/TPbzQ6kdYIp+6BXdey6UiwHazQqOlmzGX7Ft9oo5Ef/vIwBQmVKk6YOiv00gqA== X-Received: by 2002:ac8:518c:: with SMTP id c12mr24005767qtn.108.1591637829698; Mon, 08 Jun 2020 10:37:09 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.95.18.252]) by smtp.gmail.com with ESMTPSA id v189sm7484276qkb.64.2020.06.08.10.37.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2020 10:37:08 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 4AA593006D9; Mon, 8 Jun 2020 13:37:07 -0400 (-04) Date: Mon, 8 Jun 2020 13:37:07 -0400 From: Alvaro Herrera To: Andrey Klychkov Cc: Michael Paquier , Peter Eisentraut , pgsql-bugs@lists.postgresql.org, Tom Lane Subject: Re: Message-ID: <20200608173707.GA18596@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1590581418.481387288@f493.i.mail.ru> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-May-27, Andrey Klychkov wrote: > ======= > BEFORE: > ======= > > Indexes: >     "act_re_procdef_pkey" PRIMARY KEY, btree (id_) >     "act_uniq_procdef" UNIQUE CONSTRAINT, btree (key_, version_, tenant_id_) >     "act_re_procdef_deployment_id_idx" btree (deployment_id_) > ===== > AFTER > ===== > > Indexes: >     "act_re_procdef_pkey" PRIMARY KEY, btree (id_) >     "act_re_procdef_pkey_ccnew" UNIQUE, btree (id_) INVALID >     "act_uniq_procdef" UNIQUE CONSTRAINT, btree (key_, version_, tenant_id_) >     "act_uniq_procdef_ccnew" UNIQUE, btree (key_, version_, tenant_id_) INVALID >     "act_re_procdef_deployment_id_idx" btree (deployment_id_) >     "act_re_procdef_deployment_id_idx_ccnew" btree (deployment_id_) INVALID > I got the error related to the one UNIQUE index, why all the new indexes are invalid? > >There is a paragraph about the handling of invalid indexes on the > >reindex page: > >https://www.postgresql.org/docs/devel/sql-reindex.html#SQL-REINDEX-CONCURRENTLY > >"The recommended recovery method in such cases is to drop the invalid > >index and try again to perform REINDEX CONCURRENTLY. I think this part remains unanswered: why are there *three* invalid indexes, and not two? It makes sense for the UNIQUE indexes to acquire invalid duplicates, but strangely we also have a act_re_procdef_deployment_id_idx_ccnew which is *not* unique. What happened there? (I also wonder if it wouldn't make more sense to reindexdb to attempt to drop indexes that it couldn't complete.) -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services