Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAtQH-000hO1-Rs for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 16:07:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tAtQF-007rEz-71 for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 16:07:19 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAtQE-007rEo-TS for pgsql-hackers@lists.postgresql.org; Tue, 12 Nov 2024 16:07:19 +0000 Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tAtQB-001Z3j-Uj for pgsql-hackers@postgresql.org; Tue, 12 Nov 2024 16:07:18 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.stl.internal (Postfix) with ESMTP id 11A5D25400E5; Tue, 12 Nov 2024 11:07:16 -0500 (EST) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-03.internal (MEProxy); Tue, 12 Nov 2024 11:07:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm2; t=1731427635; x=1731514035; bh=DZ2AB0MLdbQWK76PeUQhqDYnWwA2oE4o MbjAKC14+Wg=; b=eJSQxNv68rQLyxxsNxv0+dtINDaPw0KIhagOFt7zDf1EqtxZ LPBTlFsYXBWRSk4EaZ4sgP560GMPVIUU6b2K+dQzFcinJC0DeDrqy6ronwqud0hh 8UcmLj6I7cSks0C/TZAf26qbu/71xnE+unUlBBx0qD5IGXo3d1W8B0KnUcq7CV8H U2mf+A/4IRuJaTMCKaApXdide/sOywwzPB6WezE/lCCtdBqxBakVHkp24QYRbmUK jMWiU9gljuZ2x5gvp5SjnYUMVw8EyedfKZaxGaU3z5K9Ik9gPQwWOeaSWZmxa1ur wFo1e6IXo36JzoZ7KYM969MgncpN4cxcRRcsxw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1731427635; x= 1731514035; bh=DZ2AB0MLdbQWK76PeUQhqDYnWwA2oE4oMbjAKC14+Wg=; b=Y SfCKk1DiPfS3X4mBlZwudvXPzf0KtEG8TBpocMIt2m5rIC5DNCJNmzPHlUdF8KAq I2YPpUpz1e5lz7GQDZ8aGS4ePUafilxgQ5uQU5iU5886PCedvqH+K2d7XxEmD8xw xT8I9ycUixG0ckG7BYcAOSHpZs4uoVSU4dzgbw6pT0488Plp3pGlxVbrOoHMm35z i0QzvuopOI59WyF0NUgaqUFX3RFyxi9n/IK0LCL/i+L1JAKt7BuOcimSyZcKMrQn TV1e2aRBe41DkEsufcsWlAhTNR3y3jS9TYEaLScYtquvh9CG0k3u381Ku8C3fVA+ yvD9tlgYQRZ87ufy8xYqQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeggdekudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeen ucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnh htrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpefgjedthfekfedtuefgieelheet leejgefhueeltdfhueetvdffudekfeejhfegheenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhr ghdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepug gvrghnrdgrrdhrrghshhgvvggusehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgshhq lhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepjhhirg hnrdhunhhivhgvrhhsrghlihhthiesghhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Nov 2024 11:07:15 -0500 (EST) Message-ID: Date: Tue, 12 Nov 2024 17:07:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Virtual generated columns To: Dean Rasheed Cc: pgsql-hackers , jian he References: <732a9543-0312-4f0c-a471-857b507a3546@eisentraut.org> <0f811f71-8c86-4e1b-b3bb-6a535674a440@eisentraut.org> <09800cb1-43aa-4239-8918-46b71ede4900@eisentraut.org> <536b281b-2cb3-4477-971f-c64838bc6263@eisentraut.org> Content-Language: en-US From: Peter Eisentraut In-Reply-To: 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 On 07.11.24 11:02, Dean Rasheed wrote: > On Tue, 5 Nov 2024 at 16:17, Peter Eisentraut wrote: >> >> New patch version. > > In expand_generated_columns_in_expr(): > > + /* > + * XXX For the benefit of triggers, make two passes, so it covers > + * PRS2_OLD_VARNO and PRS2_NEW_VARNO. > + */ > + node = expand_generated_columns_internal(node, rel, 1, rte); > + node = expand_generated_columns_internal(node, rel, 2, rte); > > It seems a bit messy to be doing these two passes in > expand_generated_columns_in_expr(), when it is only needed for > triggers. I think it was better the way it was in the v7 patch, > passing rt_index to expand_generated_columns_in_expr(), so that > TriggerEnabled() did this: > > + tgqual = (Node *) > expand_generated_columns_in_expr(tgqual, relinfo->ri_RelationDesc, > PRS2_OLD_VARNO); > + tgqual = (Node *) > expand_generated_columns_in_expr(tgqual, relinfo->ri_RelationDesc, > PRS2_NEW_VARNO); Yeah, I put it back that way in v9.