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 1j3PHc-0006EB-B0 for pgsql-hackers@arkaria.postgresql.org; Sun, 16 Feb 2020 19:08:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j3PHa-0002l0-Nh for pgsql-hackers@arkaria.postgresql.org; Sun, 16 Feb 2020 19:08:46 +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 1j3PHa-0002ks-0x for pgsql-hackers@lists.postgresql.org; Sun, 16 Feb 2020 19:08:46 +0000 Received: from mail-yb1-xb42.google.com ([2607:f8b0:4864:20::b42]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1j3PHS-0004lY-ML for pgsql-hackers@postgresql.org; Sun, 16 Feb 2020 19:08:44 +0000 Received: by mail-yb1-xb42.google.com with SMTP id l75so7636783ybf.6 for ; Sun, 16 Feb 2020 11:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=luOhMHcIH42yi6aEVnrMveDkdwYhZ9m85YcCuYJjnxA=; b=mAJFI4fjwmBw5iUmq3WrH3PPhIPa3xQ1wAXuxjmyvPRwZks/UzUiL5r4kD3/VwbeEF wpTFuKO8D6LeXXZ06emfNKOFOOFQGd3UqHd4h0/RajeuROWnkev/xs977oOUqaBRd+4Q bD/3MlfI8voTjCDWlSrp84jWxCTbK+KqZU3COJJsmLRtOh3tEv+x3rEmJ14KGGepLguU z6Q7/hdryYi15j2ogZTD6KZDQK4rZ8cNPIEmegrC0vx5umTfphjudJ4wvFNqxZC5gt2e XOe+X3VmkusigU4cB3gppTIuIKwfzVKSvgQl6MmcsB59HUssjPhmpKrsOZoDkF3eQzvb oAOQ== 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:user-agent; bh=luOhMHcIH42yi6aEVnrMveDkdwYhZ9m85YcCuYJjnxA=; b=Qz8tps4s47La6mEFotpHHDi6V2TIr7L7kxmahRRO1J/xEl+w3WuHUXc6kRn01eXuAZ 4YMqVYGWfGqBGlqq3orMUcomahCSM+OWt+d1avqZK5VVAJmH6OJG3KkNlSH7pnptQ6kl jgF7P5z+z1Z0xr+pWxf8OfHBkwWblw3ArTBt7J68V77GRQBIbXr8PLNYJkuKF5I8Xjwo W57St20vP9pN3SQl1HY4LcaRkqdWLnH6WCRNP2VWB334GBLc16HL9uy7Fb4Yd/D9yqjp Q37O+z/4c3wOd39ta0IS3ql3rMYp5hqe6n+1UnJC1kwxsrpNw1qQAbCE/2tvmcU2ny62 7aKQ== X-Gm-Message-State: APjAAAWiNngJwa2owIdTkV0TnARiBt9rdV8gV30ZHTS8Wp7G9XGmOUaB J5fTY3Dodr3hmzlOPVy9BoEBiQ== X-Google-Smtp-Source: APXvYqzb5WIyHlZR7Kntoje/oh3xROTqxtXECvFC+woNPG5gpD0IJql4B2x0Uo/y4AWt+aSVSo/Dig== X-Received: by 2002:a25:8144:: with SMTP id j4mr10781797ybm.432.1581880117903; Sun, 16 Feb 2020 11:08:37 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id g190sm5137513ywf.41.2020.02.16.11.08.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 16 Feb 2020 11:08:37 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id 93952800828; Sun, 16 Feb 2020 13:08:35 -0600 (CST) Date: Sun, 16 Feb 2020 13:08:35 -0600 From: Justin Pryzby To: Sergei Kornilov Cc: Peter Eisentraut , Michael Paquier , Andreas Karlsson , pgsql-hackers@postgresql.org Subject: reindex concurrently and two toast indexes Message-ID: <20200216190835.GA21832@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Forking old, long thread: https://www.postgresql.org/message-id/36712441546604286%40sas1-890ba5c2334a.qloud-c.yandex.net On Fri, Jan 04, 2019 at 03:18:06PM +0300, Sergei Kornilov wrote: > About reindex invalid indexes - i found one good question in archives [1]: how about toast indexes? > I check it now, i am able drop invalid toast index, but i can not drop reduntant valid index. > Reproduce: > session 1: begin; select from test_toast ... for update; > session 2: reindex table CONCURRENTLY test_toast ; > session 2: interrupt by ctrl+C > session 1: commit > session 2: reindex table test_toast ; > and now we have two toast indexes. DROP INDEX is able to remove only invalid ones. Valid index gives "ERROR: permission denied: "pg_toast_16426_index_ccnew" is a system catalog" > [1]: https://www.postgresql.org/message-id/CAB7nPqT%2B6igqbUb59y04NEgHoBeUGYteuUr89AKnLTFNdB8Hyw%40mail.gmail.com It looks like this was never addressed. I noticed a ccnew toast index sitting around since October - what do I do with it ? ts=# DROP INDEX pg_toast.pg_toast_463881620_index_ccnew; ERROR: permission denied: "pg_toast_463881620_index_ccnew" is a system catalog -- Justin