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 1snXUP-004Hut-7V for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Sep 2024 06:03:06 +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 1snXUN-006l6P-7T for pgsql-hackers@arkaria.postgresql.org; Mon, 09 Sep 2024 06:03:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snXUL-006l6H-Nr for pgsql-hackers@lists.postgresql.org; Mon, 09 Sep 2024 06:03:02 +0000 Received: from fout2-smtp.messagingengine.com ([103.168.172.145]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1snXUI-000FSp-2P for pgsql-hackers@postgresql.org; Mon, 09 Sep 2024 06:03:00 +0000 Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id 5703C1380246; Mon, 9 Sep 2024 02:02:56 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-11.internal (MEProxy); Mon, 09 Sep 2024 02:02:56 -0400 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=fm3; t=1725861776; x=1725948176; bh=/5+P+iHRy9x5oTca4DTHChJRHu+1iVwB 730yp3zAzw4=; b=oFI7fzRRbVZ5mVbWy8jbE+1Vk/jaePNKDodOuqQmUmsPAUyk WTSsA7n46fao6dPuMAoVLUl4PQpguhlRoO6SEzeDqZ+yYcCntusGYRUtdoroyNz5 E9cKGW3LWmC733460VyxnNFBvJQRr4VmzeibIa1Dj4qrpFUAvIp+7aKGd/3pohK8 arZWXKTms8rF/qjWMrZizgYSZT6huPSiSNNGjOr69FI/L36+xNRZM9jvEMO6o7FN FeeirRNhpv/5ZMz7HYJMIvDYt+alDICDGZOdjmG9eqk0PtarEpjCaiaq9EplMF+d Wd5s9MGyNx6fa+1o00s0Lhs5MoOGFNZ/s1rD+w== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1725861776; x= 1725948176; bh=/5+P+iHRy9x5oTca4DTHChJRHu+1iVwB730yp3zAzw4=; b=M i+W/Vnrm6X3qv4UDNM51H8ttvZNnRkkjYeWmcmHseHnyfIKT3EY543PgCZrBMAmp +wTZNEa4PlKQP9BrPLU82zvP2YdnNeJvheIYXw4a1CqsVq8Z24vEjeA+WuzMZFnK enJZrQE/1cIS/8oNcgipsA+TM2oujPyl5QzWjuzK+dymDkevbeYdKnD0LR7kPhUf US7gtliKAEpwcLc5NQMfewlE2Lt53ekd+O4ZzIbqq2G3Yi1RHLt1fTi2EEWq4NBv X3OTBdznstdh0keygivO8n97qguc5GvuxCbve/zeqT0Y33iy8DJypCfkuocvSs+V UOT8sHAL6neF4LvFIH9CA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeiiedgkedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpefrvghtvghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvg hnthhrrghuthdrohhrgheqnecuggftrfgrthhtvghrnhepgfejtdfhkeeftdeugfeileeh teeljeeghfeuledthfeutedvffdukeefjefhgeehnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdho rhhgpdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhope guvggrnhdrrgdrrhgrshhhvggvugesghhmrghilhdrtghomhdprhgtphhtthhopehjihgr nhdruhhnihhvvghrshgrlhhithihsehgmhgrihhlrdgtohhmpdhrtghpthhtohepphhgsh hqlhdqhhgrtghkvghrshesphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 9 Sep 2024 02:02:55 -0400 (EDT) Message-ID: Date: Mon, 9 Sep 2024 08:02:54 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Virtual generated columns To: Dean Rasheed Cc: jian he , pgsql-hackers References: <732a9543-0312-4f0c-a471-857b507a3546@eisentraut.org> <0f811f71-8c86-4e1b-b3bb-6a535674a440@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 04.09.24 12:33, Dean Rasheed wrote: >> I left the 0001 patch alone for now and put the new rewriting >> implementation into 0002. (Unfortunately, the diff is kind of useless >> for visual inspection.) Let me know if this matches what you had in >> mind, please. Also, is this the right place in fireRIRrules()? > Yes, that's what I had in mind except that it has to be called from > the second loop in fireRIRrules(), after any RLS policies have been > added, because it's possible for a RLS policy expression to refer to > virtual generated columns. It's OK to do it in the same loop that > expands RLS policies, because such policies can only refer to columns > of the same relation, so once the RLS policies have been expanded for > a given relation, nothing else should get added to the query that can > refer to columns of that relation, at that query level, so at that > point it should be safe to expand virtual generated columns. If I move the code like that, then the postgres_fdw test fails. So there is some additional interaction there that I need to study.