Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBl3N-0001XQ-JS for pgsql-general@arkaria.postgresql.org; Thu, 26 Apr 2018 17:51:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBl3M-0008Rh-1p for pgsql-general@arkaria.postgresql.org; Thu, 26 Apr 2018 17:51:32 +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.89) (envelope-from ) id 1fBl3L-0008RW-QJ for pgsql-general@lists.postgresql.org; Thu, 26 Apr 2018 17:51:31 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fBl3I-00021R-Ok for pgsql-general@postgresql.org; Thu, 26 Apr 2018 17:51:31 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B87D921847; Thu, 26 Apr 2018 13:51:26 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 26 Apr 2018 13:51:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.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; s=fm2; bh=+wvUEPpA2uYKzghZXRmChf5ezGfgE dVeINfiYIZ59kc=; b=Y2SlylwlsIyA2f4jYytCb9q2j4ktCuMcZ+fNIaC02wmqe vKSs2D0vRnQUrleQUlcUwzNprQsSVENcjGYYNHaRT+DRCcLJSBmWuWFNc5zmo+l9 0rZ57xUxkDUjrONzT05907VYC1a6NK7TMYcFNMW4d5X4Ag4aTWomlQNV8ygTI6d1 Ftb6ROFwrBaX5RiHtXlphmloXQnFXDHnkxO89oGFHTMknEn+Hl52izIB2lxb0pqq iKxeAcCqjLrfkTnD6MEKFGq592WPeJibKCKfalNfhHYLVjUmQS3sW4Bd5sFpMEHF iR268GMwEGfWutk+TsNLgnBCZFov06tplfEwL3luQ== 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; s=fm2; bh=+wvUEP pA2uYKzghZXRmChf5ezGfgEdVeINfiYIZ59kc=; b=FEM80as9bExzBIftuZ8T4F q2qNhqBu+LE9v3js3ipcyTCyqitbAu+VFVFu4bERXOrTDF2ZlTSfNlBL5Tlg3iFL BF3VDuMPBfGqyRvWBKj7NFNZamBtFaeThi9+pTMfCc+QFjgoNxUmUeLGs9ruiXC/ q5KZKlvkjyAfZ4Y5zep7LmM8R1f2i8PSxS1PDDRnfkbwa6UQZRFfLEs85NOsXonw aim/AJ5l/z2OceY02vC0Xz5q/LhYCznO0BroKnoEevnmnNTam+ByMRqMoc7txA3p 1T9w29RG4kAbqx8sCEuD6SdTIKeiQP+FS58gBBiVM6jvjns1Ag5FgUUH/syWl83w == X-ME-Sender: Received: from ranger.suse (c-73-239-117-238.hsd1.wa.comcast.net [73.239.117.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 132EFE4122; Thu, 26 Apr 2018 13:51:25 -0400 (EDT) Subject: Re: Long running INSERT+SELECT query To: Vitaliy Garnashevich , Postgres General References: <11ea9b74-243d-b275-be10-1004f51a4aa6@gmail.com> From: Adrian Klaver Message-ID: <39121e73-b04a-77c4-cb5f-55530e82f0d3@aklaver.com> Date: Thu, 26 Apr 2018 10:51:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 04/26/2018 10:45 AM, Vitaliy Garnashevich wrote: > >> SELECT .. FOR UPDATE?: >> >> https://www.postgresql.org/docs/10/static/sql-select.html#SQL-FOR-UPDATE-SHARE >> >> >> https://www.postgresql.org/docs/10/static/explicit-locking.html#LOCKING-ROWS >> > > It says: "Currently, FOR NO KEY UPDATE, FOR UPDATE, FOR SHARE and FOR > KEY SHARE cannot be specified with GROUP BY." Without the query we are flying blind, so suggestions will have a ? > > Regards, > Vitaliy -- Adrian Klaver adrian.klaver@aklaver.com