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 1rfPLK-00HUkp-Cs for pgsql-general@arkaria.postgresql.org; Wed, 28 Feb 2024 19:11:50 +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 1rfPLI-00EFmo-SJ for pgsql-general@arkaria.postgresql.org; Wed, 28 Feb 2024 19:11:49 +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 1rfPLI-00EFmg-Hl for pgsql-general@lists.postgresql.org; Wed, 28 Feb 2024 19:11:49 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rfPLF-001scB-Fe for pgsql-general@lists.postgresql.org; Wed, 28 Feb 2024 19:11:47 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 41SJBiOo2425904; Wed, 28 Feb 2024 14:11:44 -0500 From: Tom Lane To: Dominique Devienne cc: Laurenz Albe , pgsql-general@lists.postgresql.org Subject: Re: Non-Stored Generated Columns In-reply-to: References: Comments: In-reply-to Dominique Devienne message dated "Wed, 28 Feb 2024 18:38:44 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2425902.1709147504.1@sss.pgh.pa.us> Date: Wed, 28 Feb 2024 14:11:44 -0500 Message-ID: <2425903.1709147504@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Dominique Devienne writes: > Views can have foreign-keys? Surely you'd put the FK on the underlying table. > Generated view columns be indexed? You want an index on a virtual column? Sure, just build an expression index (on the underlying table) that matches it. I agree with Laurenz that it's hard to see much use-case here that's not sufficiently covered already. regards, tom lane