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.96) (envelope-from ) id 1vSg9X-003QJB-2H for pgsql-docs@arkaria.postgresql.org; Mon, 08 Dec 2025 18:40:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vSg9W-0014SU-0y for pgsql-docs@arkaria.postgresql.org; Mon, 08 Dec 2025 18:40:06 +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.96) (envelope-from ) id 1vSg9V-0014SL-37 for pgsql-docs@lists.postgresql.org; Mon, 08 Dec 2025 18:40:06 +0000 Received: from mout-u-107.mailbox.org ([2001:67c:2050:101:465::107]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vSg9S-003nip-3D for pgsql-docs@lists.postgresql.org; Mon, 08 Dec 2025 18:40:05 +0000 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-107.mailbox.org (Postfix) with ESMTPS id 4dQ9ky4y1bz9ssh; Mon, 8 Dec 2025 19:39:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ewie.name; s=MBO0001; t=1765219194; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=cgabAHiif0xlkpuoEKBo/R7p8R/1ssCQRAnkUXAzMoI=; b=qA7P/03HDAEozurcYoVF474s3noTdNxj2AuGdxYChUlz+m7F41oSI1jBkcLzJEl5fou06M qN61CcFarNfAtQlSBkgWvZGeeemTOCjz6RmINTDr5k939PiEvGd62yU4w96mUgoXf5/ome R9+J7Cg97ln65cEFRgwqswuw3sU0Z+JuxbY0lr9oW3qBVq9/5/tZeLBK5zTva6oqBv5YLK RUJQ+JxdAPXaV4KB8CWoHax0jlgjj6KA1ruX3PwykMAb8ExzGawqAKL8Ov+HKWvmo/NdGZ 7+NAL2jSAFSBdRtwFIci5kiZ36XVryTgRMzO5kxcz8HkThPRK/Rk6ZXmagZVgA== Authentication-Results: outgoing_mbo_mout; dkim=none; spf=pass (outgoing_mbo_mout: domain of ewie@ewie.name designates 2001:67c:2050:b231:465::2 as permitted sender) smtp.mailfrom=ewie@ewie.name Date: Mon, 8 Dec 2025 19:39:52 +0100 From: Erik Wienhold To: andy.hardin@gmail.com, pgsql-docs@lists.postgresql.org Subject: Re: Virtual Generated Columns Message-ID: References: <176494306051.2921398.8686936183868575892@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <176494306051.2921398.8686936183868575892@wrigleys.postgresql.org> X-Rspamd-Queue-Id: 4dQ9ky4y1bz9ssh List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-12-05 14:57 +0100, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/17/ddl-generated-columns.html > Description: > > The documentation for generated columns in PostgreSQL versions prior to 18 > mention "virtual" columns, but as far as I can tell, this is not available > prior to 18. > > In v17, this is just in the first paragraph. > > > A generated column is a special column that is always computed from other > columns. Thus, it is for columns what a view is for tables. There are two > kinds of generated columns: stored and virtual. A stored generated column is > computed when it is written (inserted or updated) and occupies storage as if > it were a normal column. A virtual generated column occupies no storage and > is computed when it is read. Thus, a virtual generated column is similar to > a view and a stored generated column is similar to a materialized view > (except that it is always updated automatically). PostgreSQL currently > implements only stored generated columns. The last sentence correctly states that Postgres v17- does not implement virtual columns. The paragraph is meant as a general overview because other RDBMS at that time had already implemented both flavors, e.g. SQLite. -- Erik Wienhold