Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d3PcR-0002UP-6V for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Apr 2017 16:16:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d3PcQ-0001Ic-PH for pgsql-bugs@arkaria.postgresql.org; Wed, 26 Apr 2017 16:16:42 +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 1d3Pbi-0007B6-Pf for pgsql-bugs@postgresql.org; Wed, 26 Apr 2017 16:15:58 +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 1d3Pbg-0006e8-5F for pgsql-bugs@postgresql.org; Wed, 26 Apr 2017 16:15:57 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B2D8F20AEC; Wed, 26 Apr 2017 12:15:54 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Wed, 26 Apr 2017 12:15:54 -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=k0WdGEjUoPWN0d1Ng8DbHMh+ozFoExXzUvLp6JXrYb4=; b=rYe/xVe0 wyPoVd60Q7bBPJcR8NdPsPlmOWpgyDXEyNl1DP8mfZIgZWfUXcun/sDz75neba+F 5aKlTfQO2gND7OTl+q66I0MmcmvrJ1u4YJp1Dcqeal62rq34mfyd0p4Pxshw678N nlD0H6NwnYyCS5MlXbXr6SYNkS/g13b5+h4ie3k2XOIbDFqRPuuglfIIDqDrU5v6 ooFUD1vTjunv7uNH7g1FTlH3ne+c6xgS2xF5nTxHuSr5h+i/YSM0TFCQTuMMScnB Wf8yogQH/HiJz2YEiqtzRcwv1y6KduXF2CA6a2ama34L3SfMo+lPdPzaarWtwl22 NeNrQJHn+YH27Q== X-ME-Sender: X-Sasl-enc: pTkZD+7FphRP2KvnudovMq50Zet3ihPkwoeGfBDLzNrE 1493223354 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 71BB824216; Wed, 26 Apr 2017 12:15:54 -0400 (EDT) Subject: Re: Concurrent ALTER SEQUENCE RESTART Regression To: Michael Paquier References: <16ed823b-44e4-dc51-3da9-a3d66b71ed5c@2ndquadrant.com> Cc: Jason Petersen , PostgreSQL mailing lists From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <9240bf94-44a8-671a-27bd-500eb868226a@2ndquadrant.com> Date: Wed, 26 Apr 2017 12:15:53 -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: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit 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 4/25/17 21:24, Michael Paquier wrote: > Yes, and that's fine, taking a stronger lock on pg_sequence would be > disruptive for other sessions, including the ones updating pg_sequence > for different sequences. The point I am trying to make here is that > the code path updating pg_sequence should make sure that the > underlying object is properly locked first, so as the update is > concurrent-safe because this uses simple_heap_update that assumes that > the operation will be concurrent-safe. For example, take tablecmds.c, > we make sure that any relation ALTER TABLE works on gets a proper lock > with relation_open first, in what sequences would be different now > that they have their own catalog? Pretty much everything other than tables is a counterexample. git grep RowExclusiveLock src/backend/commands/*.c Only tables have an underlying object to lock. Most other DDL commands don't have anything else to lock and run DDL under RowExclusiveLock. -- 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