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 1fBkxt-0001CH-Qd for pgsql-general@arkaria.postgresql.org; Thu, 26 Apr 2018 17:45:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fBkxs-0003Tb-Iw for pgsql-general@arkaria.postgresql.org; Thu, 26 Apr 2018 17:45:52 +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 1fBkxs-0003TR-94 for pgsql-general@lists.postgresql.org; Thu, 26 Apr 2018 17:45:52 +0000 Received: from mail-yb0-x243.google.com ([2607:f8b0:4002:c09::243]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fBkxi-0001tQ-VV for pgsql-general@postgresql.org; Thu, 26 Apr 2018 17:45:51 +0000 Received: by mail-yb0-x243.google.com with SMTP id y5-v6so9706730ybg.0 for ; Thu, 26 Apr 2018 10:45:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=VhkGZx2bfEvgbN3Pp9Lb/i38iGo+e6HOPMBLWLuVZLU=; b=D11blp+6q+A1sDm/+t1xCuNVyu1XRPsyYK2DArO41goDW+dh0EO43mjovwBKN4gCVg gWMsl7iNVgFg/hWqxpObZC/h/zjWQ77cVVNtfPycODR6FqEcy45eqLxDT7gH50YG47nn Ap8jVkLucNVioqP1cn+uHAx/laWZ1oo6zENh32KqNqIug4gLNlAuSoCWkkSHCDgRvIgt QO+lRJJ33yWDIsF4XI+YMy5QwNqNX00+xtpsRKmDaT91jmav87J6phOnftmGw1w8HPjz Hf6VFmFxeqUff0kxaWAKRXMNAp0Spxka2rQwPFwVeSW7gQDur4OtSScVPSfkHIXB4SE4 oTRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=VhkGZx2bfEvgbN3Pp9Lb/i38iGo+e6HOPMBLWLuVZLU=; b=J4YkwKo4+8eWl3lafg/VKLW8Me7g14CkECDv8wOesHxWADnTs6aTXElCxjRCxvbPqD xUHq6+xpEw3POU8GNg5bkf7GaPSiCPh7e7lRUYYccvU5gYpQbgnWc7ZwXIYgtCyqY0ly Z4DgMr2kg1wdP5jOVViUW6uU8NRQbevHH5Q5qRDJ3RV49jfKRiiSoDuvhUJdXDBQWyJS s5wm1mVfGOfGUjjM93Jqu3FogoVA/xEg0iDK5+IEwy8Ha0RNKCn48rX1BHWc8EivTieZ 7BG29/vfRU+48Zo3LKXSc6C0/gBBlgORYQctiQnmAClvIIk3dINdZsrorFbz/9lK7LMG 7NZw== X-Gm-Message-State: ALQs6tAFyG/mrMgpD1GOSDYMHBKSQPPADlIGXwQmO87uS93gZ82EcgDv P/5yMbGDwOI6dxxCHeRgelIU4WJI X-Google-Smtp-Source: AIpwx49h6MM9GbCbRoW1coeHMPFf4fUsbq3j8gozGZiasfSDPVtlrEdWI9qZGmopSgINxDSViSRB9Q== X-Received: by 2002:a25:bc0c:: with SMTP id i12-v6mr14941391ybh.387.1524764740816; Thu, 26 Apr 2018 10:45:40 -0700 (PDT) Received: from [192.168.1.151] ([178.54.41.83]) by smtp.gmail.com with ESMTPSA id a189-v6sm8362836ywf.96.2018.04.26.10.45.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Apr 2018 10:45:40 -0700 (PDT) Subject: Re: Long running INSERT+SELECT query To: Adrian Klaver , Postgres General References: <11ea9b74-243d-b275-be10-1004f51a4aa6@gmail.com> From: Vitaliy Garnashevich Message-ID: Date: Thu, 26 Apr 2018 20:45:37 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; 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-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > 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." Regards, Vitaliy