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 1tVYkC-009Yl5-CL for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 16:17:20 +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 1tVYkB-0031CJ-Sl for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Jan 2025 16:17: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 1tVYkB-0031CB-JL for pgsql-hackers@lists.postgresql.org; Wed, 08 Jan 2025 16:17:19 +0000 Received: from fhigh-a2-smtp.messagingengine.com ([103.168.172.153]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1tVYk8-000YzF-0o for pgsql-hackers@postgresql.org; Wed, 08 Jan 2025 16:17:18 +0000 Received: from phl-compute-03.internal (phl-compute-03.phl.internal [10.202.2.43]) by mailfhigh.phl.internal (Postfix) with ESMTP id B754B1140085; Wed, 8 Jan 2025 11:17:15 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-03.internal (MEProxy); Wed, 08 Jan 2025 11:17:15 -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=fm1; t=1736353035; x=1736439435; bh=lM2a5u+GgzD0zm0h2PCOxcce1SO60ElF txSrjMZpO/0=; b=Cqcl9NqTBmcOYeP07ErsUb92dlLQ+AAYgPonuwpaHUOaVf0F Lr7itXLL8DmNIb5tiSP4rw79pvZtcRWttRvqPC4IqEyfdnIKSEU8oveKoiVGI5lO X8sYQz2eBIvJI26oBTHnyWpTR6FHBG7KALOsMDMGN25YWEQ9gGUuCBOcJN4Zav5t 2vrlWCKXMk6jCmczz6j/Btrb3aHemcZ0asUjmMsNZ27fh57GWaRgGaxNRJoZN4b4 PEKR9UPzYU8tYqF+22TnQKl4JujNMD+HtsLuAJCy0Mm+xkl0dc3J5TIW3Zt7PcW7 EjcYmsja4vJ2eQFIyw6IxIKHnKq8UI6ceUoRCA== 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=fm2; t=1736353035; x= 1736439435; bh=lM2a5u+GgzD0zm0h2PCOxcce1SO60ElFtxSrjMZpO/0=; b=O Jqo9U2B8Vwg10oE7I3qnnRYRX7yzC5vlm8+lH2pcHIDO+ZoyUTwdL/TPK4asLmRt F8/i+YKB09aaSEp8jzF+Fihd2cL7NiKFaWRdT+XesN8OiwXAmqONKjrVeRyHvkdr zoXZ/CB/SyaWCdmRjtRXwrXerNDLzVRCBWXR0pxxQE66tlMKxXcbDXtqpf83LHFU V31XFjUSxsjTxJTKrzfB1nVnY3ZyZoZU8PH15DnW0khRErb2mMnbeVw3J9foFfuW Dva7fr035vucglt/Ovde74jwykH+SDBZaJRvJ1Tik4qpnpPHPwKrVz428SV87KeK F5mCl5qz+EfxNmibZpaBw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudeggedgkeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdej necuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvg hnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepjefhveehtdetgfffhffhfeef gffghffflefgieeuueekhedvhedvfeehffdvfeeunecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdho rhhgpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhope hjihgrnhdruhhnihhvvghrshgrlhhithihsehgmhgrihhlrdgtohhmpdhrtghpthhtohep phhgshhqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtoh epuggvrghnrdgrrdhrrghshhgvvggusehgmhgrihhlrdgtohhm X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 8 Jan 2025 11:17:14 -0500 (EST) Message-ID: Date: Wed, 8 Jan 2025 17:17:13 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Virtual generated columns To: jian he Cc: pgsql-hackers , Dean Rasheed 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> <51875199-d5f5-41ed-92dc-3e7b1b996991@eisentraut.org> Content-Language: en-US From: Peter Eisentraut In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 04.12.24 05:55, jian he wrote: > On Fri, Nov 29, 2024 at 6:13 PM Peter Eisentraut wrote: >> >> - Added support for virtual columns in trigger column lists. (For that, >> I renamed ExecInitStoredGenerated() to ExecInitGenerated(), which >> handles the computation of ri_extraUpdatedCols.) >> > > why not duplicate some code from ExecInitStoredGenerated to > ExecGetExtraUpdatedCols? This answers itself: I'd rather not duplicate code. I don't see that as an improvement. > * now the expression is that something initiated for the virtual > generated column. which may not be necessary for virtual columns. > let's make ResultRelInfo->ri_GeneratedExprsI, > ResultRelInfo->ri_GeneratedExprsU be NULL for virtual columns. > > currently it may look like this: > (gdb) p resultRelInfo->ri_GeneratedExprsU > $20 = (ExprState **) 0x34f9638 > (gdb) p resultRelInfo->ri_GeneratedExprsU[0] > $21 = (ExprState *) 0x0 > (gdb) p resultRelInfo->ri_GeneratedExprsU[1] > $22 = (ExprState *) 0x0 > (gdb) p resultRelInfo->ri_GeneratedExprsU[2] > $23 = (ExprState *) 0x40 I have fixed that in v11. > * ExecInitStoredGenerated main used in ExecComputeStoredGenerated. > * we also need to slightly change ExecInitGenerated's comments. also fixed > * in InitResultRelInfo, do we need explicit set ri_Generated_valid to false? Doesn't seem necessary. The struct is initialized to zero at the beginning.