Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kOfVZ-0000MU-4p for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Oct 2020 11:15:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kOfVX-0003uW-Vb for pgsql-hackers@arkaria.postgresql.org; Sat, 03 Oct 2020 11:15:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kOfVX-0003uP-LH for pgsql-hackers@lists.postgresql.org; Sat, 03 Oct 2020 11:15:19 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kOfVQ-0006RH-8z for pgsql-hackers@postgresql.org; Sat, 03 Oct 2020 11:15:19 +0000 Received: by mail-wr1-x443.google.com with SMTP id z1so4524964wrt.3 for ; Sat, 03 Oct 2020 04:15:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=/rnfNRY43gHYuTBrQoaQTXSyHGtSxxI0SWqi5Wd4t5U=; b=VMZ8tIECQO7qb6R3CILCE/+DYvot7BnXuMqEF8BiNbgGWq60ArIMA23mPAtac4eaNv Jz1iNiivXhcsiGWrdzzX+ABzPK5NnfDUPdUSEZZJw4NBpvfzAKftdjjikWgxg5ouTukv owcWcGJOTxxeu/GduvV5MxnhwfGQ1YSVMPxrQnKLiGxrUqCDrTBjA0eDWXcfPw+YHQ/6 YOJH5l3+Ia4Gz/+qc+DREmvCOHhy65jGVXEano7daNVi71WUD4Squ4532xVZog6k1xnW t4+5MtIWz4S45AndQ/6PhrLCg1d6RAVOHwIUIhdcVxIK0euE8FsrcWIbvpM9AHgLWPhU sEkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=/rnfNRY43gHYuTBrQoaQTXSyHGtSxxI0SWqi5Wd4t5U=; b=H61UcFNZQqTEOygMsxweejeJLcHDNmeE0rsGNG+iMsM72NLvZKQaB5Yhj+AHTGkInO 3AwHCw5mVouI4qTrxTnhF/RRpzNbCUb2N/gacTxQbf7Msc6xUGTm7kvFHK0Ifwkel0lv ikeYGXv3qherrRM+WwkjK0fBmsmQhNDnBbdxOcXpUv5cIwbKdEYxO2Jq83LrNEM1ZrG2 j8ootC2Jy77u6dVsPSJpR4x+BJymYPdo8jptqireOEJzv4wSB3cQVx8pOoV98HD3mKce 5JT79UGqEVbkmM5rSOsRLiAZgRl75uD1laLSpW02lzL3pBQW3xE8Q9YH2ydTINbDFUpe HuDg== X-Gm-Message-State: AOAM5336T2y8VwXOc/0MbQHb+F0nxs3esCp/axYbBafTSQ0LVi+wIA4c rfpFqz/EwiOPqhzip6sbmovGGA== X-Google-Smtp-Source: ABdhPJzD6AKyuv8DPBOkX42hiNBvCCkoPEgK8qpXlIwCHmpqXhzwM2XFHE5UMeXXDGYeK3QOrLM5qg== X-Received: by 2002:adf:ec92:: with SMTP id z18mr1781238wrn.53.1601723711412; Sat, 03 Oct 2020 04:15:11 -0700 (PDT) Received: from localhost (ip-86-49-245-76.net.upcbroadband.cz. [86.49.245.76]) by smtp.gmail.com with ESMTPSA id f23sm4341238wmc.3.2020.10.03.04.15.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 03 Oct 2020 04:15:10 -0700 (PDT) Date: Sat, 3 Oct 2020 13:15:09 +0200 From: Tomas Vondra To: Amit Langote Cc: "David G. Johnston" , PostgreSQL-development Subject: Re: a misbehavior of partition row movement (?) Message-ID: <20201003111509.hgxgu46uj7hijmvd@development> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Oct 03, 2020 at 11:42:21AM +0900, Amit Langote wrote: >On Fri, Oct 2, 2020 at 11:32 PM David G. Johnston > wrote: >> On Friday, October 2, 2020, Amit Langote >> wrote: >>> >>> >>> Reporter on that thread says that the last update should have failed >>> and I don't quite see a workable alternative to that. >> >> >> To be clear the OP would rather have it just work, the same as the >> non-row-movement version. Maybe insert the new row first, execute >> the on update trigger chained from the old row, then delete the old >> row? > >I was thinking yesterday about making it just work, but considering the >changes that would need to be made to how the underlying triggers fire, >it does not seem we would be able to back-port the solution. > I think we need to differentiate between master and backbranches. IMO we should try to make it "just work" in master, and the amount of code should not be an issue there I think (no opinion on whether insert and update trigger is the way to go). For backbranches we may need to do something less intrusive, of course. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services