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.92) (envelope-from ) id 1jBNF2-0004oA-FE for pgsql-general@arkaria.postgresql.org; Mon, 09 Mar 2020 18:35:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jBNF0-0005Eu-UU for pgsql-general@arkaria.postgresql.org; Mon, 09 Mar 2020 18:35:02 +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 1jBNEz-0005EV-4F for pgsql-general@lists.postgresql.org; Mon, 09 Mar 2020 18:35:02 +0000 Received: from [66.111.4.25] (helo=out1-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jBNEr-0006wz-OU for pgsql-general@postgresql.org; Mon, 09 Mar 2020 18:34:59 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 6A1C6220F1; Mon, 9 Mar 2020 14:34:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 09 Mar 2020 14:34:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:content-transfer-encoding:in-reply-to; s=fm1; bh=c K1n3m8J5FK2CNqidrIUxhPgTyRH84i9b9f0jfYI61s=; b=DMMMkXj7LiQWqOVLQ +zhRlvzISmvQtXkssRItPXbgUeJGGirky5sLdyM9okbdJqStNGiHT4ZHytXoAaT1 HauuPFTkXgyw7OxdwG0N8WWKBSqL6rupT05w7ZyNq2PZT/IYVOTTnK1Zav0pSoHm nEqQ6QWuHoCcRhV8WYW/XdCaLM1jnipuJAtUxbc5MTwcOftupl/mfcHQH8LKFnB2 NdKYG//L5Y/SkcOXhomKF9gbZnMcZwWXmlRMX6von9ZiL21vpMokh7mkdBWqMTy8 EocUnnIkTtdY9zSnvqZYnr7TOvd7/gsFZJ/QwmVAKFadq3v1/t8hnojusJWw9JIA CXa1Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=cK1n3m8J5FK2CNqidrIUxhPgTyRH84i9b9f0jfYI6 1s=; b=3qFRPfOB33F1dmr1sxmdMXUsab8kkw5sBXD6zI0VzKFY+NEukXJ42Aa2w QS4bpEFjo5ps1rrtIUEORQHCZxsjHnpu9wz0aFwRg0xHzst6OYgZ2jd+Kwv6+0tX aQ2zdtp/kvMw1uRLWpWcJrNnwGXRTmmV+7HiS95wkGDhbGFBM7Cqh+xI4j/KzWXm 9/Bto0bRP1pG5tdL1TEfh2DVsmH7Pt05+tevJBYkIi20z9CVXqZN007d55fGcEAK j8W1KM56G1Q4cCEFioTtgWCyNEJl9lRSv8drWHABd0Wam2sehwbxBfgN/U13kXgX KBRE1TjaFJzVA5TWEA9p0ODfILITQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddukedguddugecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvuffkfhggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetnhgu rhgvshcuhfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkph epieejrdduiedtrddvudejrddvhedtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: from intern.anarazel.de (c-67-160-217-250.hsd1.ca.comcast.net [67.160.217.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 87A013280059; Mon, 9 Mar 2020 14:34:41 -0400 (EDT) Date: Mon, 9 Mar 2020 11:34:40 -0700 From: Andres Freund To: Kouber Saparev Cc: Tom Lane , pgsql-general@postgresql.org Subject: Re: Is it safe to rename an index through pg_class update? Message-ID: <20200309183440.hptayvs3axqtfc27@alap3.anarazel.de> References: <21995.1582818756@sss.pgh.pa.us> <20200306173805.4yznqcchzojzk7dl@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.25 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2020-03-09 17:47:23 +0200, Kouber Saparev wrote: > На пт, 6.03.2020 г. в 21:00 Andres Freund написа: > > On 2020-02-27 10:52:36 -0500, Tom Lane wrote: > > > FWIW, I can't immediately think of a reason this would cause a problem, > > > at least not on 9.4 and up which use MVCC catalog scans. If you're > > > really still on 9.3 then it's notably more risky. In any case, I've > > > not had any caffeine yet today, so this doesn't count for much. > > > > It likely could cause some problems if somebody concurrently executed > > DDL affecting the same table. At least some "concurrently updated" > > errors, and perhaps some worse ones. I'd at least add an explicit LOCK > > TABLE on the underlying table that prevents concurrent catalog > > modifications. > > > > I am trying to escape the Access Exclusive lock over the table indeed, > otherwise I would use the ALTER statement instead anyway, which makes a > lock implicitly. Thanks for the responses. You'd not have to take an ACCESS EXCLUSIVE. A lower level would suffice, e.g. SHARE UPDATE EXCLUSIVE, which still allows data changes. > There is nobody else doing DDLs except me - Mr. DBA, so I guess I am > safe on this side. ;) If autovacuum triggered a vacuum/analyze it'd would e.g. also try to update pg_class. Greetings, Andres Freund