
Postgres Gains Support for Generated on Write Columns - haney
https://github.com/postgres/postgres/commit/fc22b6623b6b3bab3cb057ccd282c2bfad1a0b30
======
haney
I'm really excited for this, there are so many times that I override backend
code to pre-compute a column and then save it, the ability to just define a
generated value that is indexable that Postgres can keep up to date without
triggers is really exciting.

~~~
anarazel
Note that that often will be doable just as an expression index. Say CREATE
INDEX foo ON bar(my_function(cola, colb)); which then can answer questions
like SELECT * FROM bar WHERE my_function(cola, colb) = 'zaphod'; if
my_function is immutable. That has the advantage of not needing additional
space in the table, just the index.

Of course, there are plenty cases where one still wants to have generated
columns.

