Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d5ZBB-0006P7-K9 for pgsql-bugs@arkaria.postgresql.org; Tue, 02 May 2017 14:53:29 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1d5ZBB-0001Gx-2K for pgsql-bugs@arkaria.postgresql.org; Tue, 02 May 2017 14:53:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d5ZBA-0001Gn-CG for pgsql-bugs@postgresql.org; Tue, 02 May 2017 14:53:28 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1d5ZB3-0007PG-TZ for pgsql-bugs@postgresql.org; Tue, 02 May 2017 14:53:27 +0000 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 4DB3020BB4; Tue, 2 May 2017 10:53:20 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Tue, 02 May 2017 10:53:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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=xYWEy26Gy/yLy5ueB1ppJG2oApT6TuTKbB12wEJ7u8E=; b=FlqpMVvg r2m6DKalneW40MxpfQKWUi3xNPT6m10/I7DzaTDErnhztsvXa1Rp6yPP0GLhKHLO 3pTOOcm91PorfzXGstKuSgI4Lu+QfdmfzWUYoJlcAU7cQFelP/Tbqoc2E0uNrD6+ VUxwToR9DHiHE1BkRNN24eM3AO8+Tdwn427a40eBLmoqRh53YG9UXNS0zgAYcZpZ ppPo08ZAV8S6eLRmM0v88yuBUT6KQtxpI7VQ2JnEpuNJkKYTMCPqhxITW/1ictRA UixvaPs1ZcwwWEtuvYZNFA4eJiGnti0AJP/XIqxl7mVXS9hjqu5Cmtk2AdPnWwgC 3HsRgDYRdNgjBA== X-ME-Sender: X-Sasl-enc: 9xKfmbat5KfjXtBkFAD8wLNXc5GfjbHMsoCgT9xkF3lB 1493736800 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 1DFF224033; Tue, 2 May 2017 10:53:20 -0400 (EDT) Subject: Re: Concurrent ALTER SEQUENCE RESTART Regression To: Jason Petersen , pgsql-bugs@postgresql.org References: From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Tue, 2 May 2017 10:53:19 -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/24/17 15:52, Jason Petersen wrote: > 1. Create a new sequence: CREATE SEQUENCE my_seq; > 2. Start this loop twice in different shells: > while true; do psql -1Xtc 'ALTER SEQUENCE my_seq RESTART 1'; done > Each loop should repeatedly succeed and simply print ALTER SEQUENCE over and over. > The output stream is punctuated by occasional "ERROR: tuple concurrently updated" messages. This message comes from the pg_sequence catalog update. But in the case of the RESTART clause, you don't need to update the catalog, because it just needs to write to the sequence's relation. So I have tweaked the code a little to omit the catalog update if it's not needed. Your test case works without errors now. -- 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