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 1titQQ-003Tg4-Cl for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Feb 2025 11:00:02 +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 1titQN-007gCz-Gw for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Feb 2025 11:00:00 +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 1titQM-007gCq-9m for pgsql-hackers@lists.postgresql.org; Fri, 14 Feb 2025 10:59:59 +0000 Received: from fout-b1-smtp.messagingengine.com ([202.12.124.144]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1titQJ-000mqG-16 for pgsql-hackers@postgresql.org; Fri, 14 Feb 2025 10:59:58 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.stl.internal (Postfix) with ESMTP id EEC5D1140149; Fri, 14 Feb 2025 05:59:51 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Fri, 14 Feb 2025 05:59:52 -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=1739530791; x=1739617191; bh=TS8YOoVqMeBrG6XQoSWECh/GDZuy63cJ 4MWxXeVNSBk=; b=BXVWFsMMrvLRe6q7VXDTdC/ek2uoHM1XR04vxuVxvJ8CC1UD eIPcAQu8ZdepwCZwkhWx0e5sWm986aC+8w5fkjH3Soxv8m9h3LcxoIxIbY+7zi1V J/l39NolVr5LI5SacS5wLNzL6L0RVphN4VkhysQIuw398FAdmueAfczj8VNqi0SD wgGsK/dFtC+u7++6YAAIzlA7lnHBTapnf/3hwhDkSBct8sSX0wVXxSgJFQpQHBYJ X5h68TnfSw2mwYJ+iotth1drqEiFLRVyOFZ0KBd2ov46JRWr4HOu+c7GRPRRkODm XEXvUPuDk0NBHGg7n7oJWAWhUnFR0UbiSVk67A== 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=1739530791; x= 1739617191; bh=TS8YOoVqMeBrG6XQoSWECh/GDZuy63cJ4MWxXeVNSBk=; b=N vq+F+10dwqlqAq3Gv2UJUDiJYzQHdIut7dsDVywP8dbrXuPRO3/DeYfTMsffTVus aGL0zR+7fOdvGABnCP/EV9BuiEKrpiKY6TRvF5YhPsTgB0rV+ljZIUzatZmDWpBU VZbAptddqqQIPxHeLAN8kpxV9uXSozrfAqp8hAQhDi65LQdjn9mFHZdYSX9ceJj9 KD/8R2dmHcESqNG1kwlL6B3GENNt/KV/O3hCjOACCai4m4gUaOye7nZBOI07aE8q WKO0Bg1Nlf3BcpQKqGn//por2VXe9dZ9MyJVnJFamQ6adGaumn4+hn5V21N68Jcx ghKg6pu0wuf0vTpuN9fTw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegleegkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddv jeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghish gvnhhtrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpefgjedthfekfedtuefgieel heetleejgefhueeltdfhueetvdffudekfeejhfegheenucevlhhushhtvghrufhiiigvpe dtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdr ohhrghdpnhgspghrtghpthhtohepiedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoh epjhhirghnrdhunhhivhgvrhhsrghlihhthiesghhmrghilhdrtghomhdprhgtphhtthho pehguhhofhgvnhhglhhinhhugiesghhmrghilhdrtghomhdprhgtphhtthhopeiimhhlph hoshhtghhrvghssehgmhgrihhlrdgtohhmpdhrtghpthhtohepuggvrghnrdgrrdhrrghs hhgvvggusehgmhgrihhlrdgtohhmpdhrtghpthhtohepvgigtghluhhsihhonhesghhmrg hilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehpohhsthhgrhgv shhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 14 Feb 2025 05:59:50 -0500 (EST) Message-ID: Date: Fri, 14 Feb 2025 11:59:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Virtual generated columns To: jian he , Richard Guo Cc: Zhang Mingli , Dean Rasheed , Alexander Lakhin , pgsql-hackers References: <831d7f99-0618-48e5-8557-f3d57137f339@eisentraut.org> <64c2468c-3b69-44d7-863a-165931a70c1d@eisentraut.org> <8be3512a-a23f-4088-a9ec-bf68650a2997@eisentraut.org> <75eb1a6f-d59f-42e6-8a78-124ee808cda7@gmail.com> <8d6a3d4c-f630-4cf9-aced-6cead95776e5@Spark> <12d5cce9-917f-4a99-86d3-715bb3b363bb@Spark> 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 13.02.25 14:06, jian he wrote: > I didn't solve the out join semantic issue. > i am wondering, can we do the virtual generated column expansion in > the rewrite stage as is, > and wrap the expressions in PHVs if the virtual generated > columns come from the nullable side of an outer join. PlaceHolderVar looks like a fitting mechanism for this. But it's so far a planner node, so it might take some additional consideration if we want to expand where it's used. Maybe a short-term fix would be to error out if we find ourselves about to expand a Var with varnullingrels != NULL. That would mean you couldn't use a virtual generated column on the nullable output side of an outer join, which is annoying but not fatal, and we could fix it incrementally later.