My Favorite Postgresql 18 Feature: Virtual Generated Columns
Posted4 months agoActive4 months ago
tselai.comTechstory
calmpositive
Debate
40/100
PostgresqlDatabase FeaturesSQL
Key topics
Postgresql
Database Features
SQL
The article discusses the new virtual generated columns feature in PostgreSQL 18, and the discussion revolves around its usefulness and comparisons to existing features and alternatives.
Snapshot generated from the HN discussion
Discussion Activity
Light discussionFirst comment
5h
Peak period
4
6-8h
Avg / period
1.8
Key moments
- 01Story posted
Sep 11, 2025 at 1:47 PM EDT
4 months ago
Step 01 - 02First comment
Sep 11, 2025 at 6:51 PM EDT
5h after posting
Step 02 - 03Peak activity
4 comments in 6-8h
Hottest window of the conversation
Step 03 - 04Latest activity
Sep 12, 2025 at 9:25 PM EDT
4 months ago
Step 04
Generating AI Summary...
Analyzing up to 500 comments to identify key contributors and discussion patterns
ID: 45214209Type: storyLast synced: 11/20/2025, 4:50:34 PM
Want the full context?
Jump to the original sources
Read the primary article or dive into the live Hacker News thread when you're ready.
At least one demonstrable difference I can see between your recollection and this feature is that the column name being part of the DDL pushes the logic down into the DDL, versus every client having to carry that magic expression around with them. I think it's likely the age-old application-logic-client-side versus stored-proc camps
as compared to <<select id, silly from my_table>> for the consumerBut if a function called silly with input type my_table existed, you could still do your second query. It has syntactic sugar for making a bare function name implicitly invoke on the current row record.
I can't remember if that sugar could also be used in an expression index. I never really used this syntactic feature, as I thought being more explicit with function calls would be better coding style.
You can, and probably should, do these things in your application code. I mean, it's not really that hard to make a string lowercase, you don't need to define a "virtual colum" for that...
Can’t wait!