Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flKZ9-0001qc-Ns for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Aug 2018 20:51:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1flKZ7-000235-RL for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Aug 2018 20:51:21 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flKZ7-00022y-AX for pgsql-hackers@lists.postgresql.org; Thu, 02 Aug 2018 20:51:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1flKZ4-0002dQ-SJ for pgsql-hackers@postgresql.org; Thu, 02 Aug 2018 20:51:20 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w72KpApo006646; Thu, 2 Aug 2018 16:51:10 -0400 From: Tom Lane To: Robert Haas cc: Andres Freund , Peter Eisentraut , Andrey Klychkov , Victor Yegorov , PostgreSQL Hackers Subject: Re: Alter index rename concurrently to In-reply-to: References: <1531828116.497549417@f411.i.mail.ru> <6cf6b35f-b730-60fc-bab7-82699dca59ed@2ndquadrant.com> <10678.1533072318@sss.pgh.pa.us> <4aadd527-9986-36bd-978c-2300a95e7aec@2ndquadrant.com> <20180801193616.gi7mfs4kn5kggamf@alap3.anarazel.de> <20180802200251.ekgtnkqpgfsmfmdf@alap3.anarazel.de> Comments: In-reply-to Robert Haas message dated "Thu, 02 Aug 2018 16:30:42 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6644.1533243070.1@sss.pgh.pa.us> Date: Thu, 02 Aug 2018 16:51:10 -0400 Message-ID: <6645.1533243070@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > [ reasons why DDL under less than AEL sucks ] Unfortunately, none of these problems are made to go away with an AcceptInvalidationMessages at statement start. That just makes the window smaller. But DDL effects could still be seen - or not - partway through a statement, with just as much ensuing hilarity as in your example. Maybe more. The real issue here, and the reason why I'm very unhappy with the mad rush in certain quarters to try to reduce locking levels for DDL, is exactly that it generally results in uncertainty about when the effects will be seen. I do not think your proposal does much more than put a fig leaf over that problem. Barring somebody having a great idea about resolving that, I think we just need to be very clear that any DDL done with less than AEL has exactly this issue. In the case at hand, couldn't we just document that "the effects of RENAME CONCURRENTLY may not be seen in other sessions right away; at worst, not till they begin a new transaction"? If you don't like that, don't use CONCURRENTLY. regards, tom lane