Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d9Bfa-0000We-5H for pgsql-bugs@arkaria.postgresql.org; Fri, 12 May 2017 14:35:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d9BfZ-0007cc-FO for pgsql-bugs@arkaria.postgresql.org; Fri, 12 May 2017 14:35:49 +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.84_2) (envelope-from ) id 1d9BfY-0007bw-Ey; Fri, 12 May 2017 14:35:48 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d9BfV-000594-Nh; Fri, 12 May 2017 14:35:47 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id A2F262084E; Fri, 12 May 2017 10:35:44 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Fri, 12 May 2017 10:35:44 -0400 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-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=eG+9R6mjXhWCfa4aqAVDovBuPqN59ynVEjkRb23MBbI=; b=SIb3+CHU /0CQKlulWWGRvSCv3tR/Zo/59FeXwdJKLDxUSIJ8uaGYQq972tfLasXYafq8B6Tw Ht5us6LMqhDhJq4ca7iUOenu3ZwFvoWvc3oaQ7KY/O+B3EEjyZR2s0ZPLqyyJPpQ 1kMk1+esnda1jKI0sFINZQgyuebgtWfgcm2Wb8UFRvbylsNgtgCN4+YeG3lEuXO9 0eRpxqNjQJ1wtTfusuNIUjB81ItbRFUXWjadbguqNeyysAoYLq2Yf+bjdiAgDG3q IfAjd3IADkmVw3oylBbsDpsw+VypRjU/CcOJWI78U8AYnSWuUklNReMhykpwOaNP boZUI2jniUxnwA== X-ME-Sender: X-Sasl-enc: 5M5WzjCjnAh1/l2CuDnrc4ObgW6yyD8+JwE0AR19H5CK 1494599744 Received: from april.local (c-73-13-66-39.hsd1.pa.comcast.net [73.13.66.39]) by mail.messagingengine.com (Postfix) with ESMTPA id 395B324950; Fri, 12 May 2017 10:35:44 -0400 (EDT) Subject: Re: [HACKERS] Concurrent ALTER SEQUENCE RESTART Regression To: Tom Lane , Andres Freund References: <20170430080517.GA811193@rfd.leadboat.com> <59aeb834-b113-6769-bfe4-65f2f8c875e3@2ndquadrant.com> <20170507234334.yimkp6aq2o43wtt2@alap3.anarazel.de> <4521f870-bb1f-1b29-3b3f-42419696efe7@2ndquadrant.com> <20d59e42-4a08-fa34-29df-9f54b3ef5ba7@2ndquadrant.com> <2913.1494426542@sss.pgh.pa.us> <20170510162450.bzfktkeexezepf6c@alap3.anarazel.de> <90255529-1de1-0aad-c545-f75d08479a9a@2ndquadrant.com> <8863.1494537678@sss.pgh.pa.us> <20170511212839.b6i6xccdv5slrttx@alap3.anarazel.de> <25950.1494561596@sss.pgh.pa.us> Cc: Petr Jelinek , pgsql-hackers@postgresql.org, Noah Misch , Jason Petersen , Michael Paquier , PostgreSQL mailing lists From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <10d030f9-a494-f9e4-bec0-117acce994ef@2ndquadrant.com> Date: Fri, 12 May 2017 10:35:56 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <25950.1494561596@sss.pgh.pa.us> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 5/11/17 23:59, Tom Lane wrote: > Right, but the existing code is *designed* to hold the lock till end of > top-level transaction, regardless of what happens in any subtransaction. > My understanding of your complaint is that you do not think that's OK > for any lock stronger than AccessShareLock. What he is saying (I believe) is: Because of that custom logic to hold the lock until the end of the transaction across subtransactions, you will keep holding the lock even if a subtransaction aborts, which is nonstandard behavior. Previously, nobody cared, because nobody else was locking sequences. But now we're proposing to make ALTER SEQUENCE lock the sequence, so this behavior would be visible: S1: BEGIN; S1: SAVEPOINT s1; S1: SELECT nextval('seq1'); S1: ROLLBACK TO SAVEPOINT s1; S2: ALTER SEQUENCE seq1 MAXVALUE 100; -- would now wait for S1 commit My amendment to that is that "previously nobody cared" is not quite correct, because the same already happens currently with DROP SEQUENCE. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs