---
title: "PostgreSQL 18 - VIRTUAL Generated Columns"
url: https://daily.dev/posts/postgresql-18---virtual-generated-columns-t3n4j4kvy
source_url: https://hashrocket.com/blog/posts/postgresql-18-virtual-generated-columns
type: article
source: "Hashrocket"
published: 2025-11-04T14:04:09.557Z
updated: 2025-11-04T14:04:28.788Z
tags: ["performance", "database", "sql", "postgresql"]
reading_time: 4
upvotes: 19
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# PostgreSQL 18 - VIRTUAL Generated Columns

**[Hashrocket](https://daily.dev/sources/hashrocket)** · 4 min read · 19 upvotes · 0 comments

## Summary

PostgreSQL 18 introduces VIRTUAL generated columns as the new default, computing values on-the-fly at query time instead of storing them on disk. Unlike STORED columns that existed since version 12, VIRTUAL columns save disk space but cannot be indexed. The choice between VIRTUAL and STORED depends on computation complexity, query patterns, and whether storage efficiency or query performance is prioritized. Simple concatenations work well as VIRTUAL, while complex computations or frequently filtered columns benefit from STORED with indexes.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://hashrocket.com/blog/posts/postgresql-18-virtual-generated-columns>

## Similar posts on daily.dev

- [Virtual columns, real bugfixes](https://daily.dev/posts/virtual-columns-real-bugfixes-gocrydgka) · Rails · 1 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#database](https://daily.dev/tags/database), [#sql](https://daily.dev/tags/sql), [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/postgresql-18---virtual-generated-columns-t3n4j4kvy)
