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 1pZmqT-000678-CO for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Mar 2023 06:00:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pZmqS-0007u6-02 for pgsql-bugs@arkaria.postgresql.org; Wed, 08 Mar 2023 06:00:12 +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 1pZmqR-0007tx-MN for pgsql-bugs@lists.postgresql.org; Wed, 08 Mar 2023 06:00:11 +0000 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pZmqK-0007eY-Qm for pgsql-bugs@lists.postgresql.org; Wed, 08 Mar 2023 06:00:11 +0000 Received: by mail-lf1-x12a.google.com with SMTP id t11so19995382lfr.1 for ; Tue, 07 Mar 2023 22:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678255203; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=iLHO3cMxtlp8nXm/IYozCiDK75uSWEfqtQ2zUuPKyTY=; b=Tx0n1RHXxmWqyLvvFkfYWvEjyOTEpWgcSuP3Pt1DAbejtBn2gGOB/Aar2isvjq4Gx1 HYeJsNg8HTqqZH+1JdBOQz6JRYfn6HNP13CFx8tLEnFiRP+wLCIlmLtJ4uifEybZLPv8 HlmFZSgVXcXuCr+ZvmH+lJroYPXkIcxBoinVsSq9qvQL6ZGlBiOTweHJ/cmpATgfj3Mq HGH1av8aZbTLPFTAito5QibJKLF0cQhptri+Ga52dGR0Qk365+Xdlp61FHGHvwno5e/y GLq7MinlJxL5wyTPop6ekkHrKCdCSxOXwmmJv5jz43HzQja1RqJGRdyFCFKgKyxBYyIq C+MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678255203; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iLHO3cMxtlp8nXm/IYozCiDK75uSWEfqtQ2zUuPKyTY=; b=Yxt6W+bYaCKZQRiEPv2nW4EQyvWOqnaOtpjrjIl8slh+JWQIR/1g3lXlhNXEJmn/3n fipjSRO+60Yz8w/3L4MRP/8RQPasL41FQeSTILw10vpywQ3EwXoCx7Mk+JhMP47Ngb+p n1Ed5vxcLl5zbbQmGkqcCbtm4SldvZA2AxPbwPpKMRg0/FJ2mHrY3sbtU2ib/BGGIJg+ wjyBGPxtk2ATMHGO2z2JyEPFkgai6oOsTxO2EkNo4if46ZgXSpHYshk3SzbFpJCOs3qy 5mSsDWnjIgHxfS+VBLfeJ1dfDrtAPp3XAIwSwmC0s3BmoszEyV9oZ80XdrrQQHW2TRLE 68LQ== X-Gm-Message-State: AO0yUKVUalKjm0SAgz8i3Z3T9ko1cKRUqfS+X8L80Df/rVw3BvWNsyKv nmmPI44nVdwXXpxsF6Ox03s= X-Google-Smtp-Source: AK7set8vxnzmG23FE1NEVOYZfQYwg/iD3AAozzb66R4Bwm1cbfOzCViSu837015p2QUZkxmMYkR+UQ== X-Received: by 2002:ac2:5106:0:b0:4dd:9ddc:4465 with SMTP id q6-20020ac25106000000b004dd9ddc4465mr5919161lfb.55.1678255202703; Tue, 07 Mar 2023 22:00:02 -0800 (PST) Received: from [1.0.0.7] ([178.155.5.178]) by smtp.gmail.com with ESMTPSA id h15-20020ac250cf000000b004a0589786ddsm2247671lfm.69.2023.03.07.22.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Mar 2023 22:00:01 -0800 (PST) Message-ID: Date: Wed, 8 Mar 2023 09:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: BUG #17811: Replacing an underlying view breaks OLD/NEW tuple when accessing it via upper-level view Content-Language: en-US To: Tom Lane Cc: pgsql-bugs@lists.postgresql.org References: <17811-d31686b78f0dffc9@postgresql.org> <4022282.1678214585@sss.pgh.pa.us> From: Alexander Lakhin In-Reply-To: <4022282.1678214585@sss.pgh.pa.us> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 07.03.2023 21:43, Tom Lane wrote: > I've looked into this a bit more, and both of these symptoms reduce > to the same thing: after we've plugged the modified view's query > into the upper query, we have an RTE_SUBQUERY RTE whose eref->colnames > list is shorter than the number of columns actually available from the > subquery. This breaks assorted code that is expecting that it can > use list_length(eref->colnames) as a quick guide to the number of > output columns. Thanks for the fix! I've tested all my cases on REL_15_STABLE, master and found no anomalies in this area. Best regards, Alexander