News for hackers. Stuff that matters.
Re:New In Postgres 12: Generated Columns by ako on Wednesday October 02, 2019 @06:52AM (#21135033)
Make a trigger
Re:New In Postgres 12: Generated Columns by grzm on Wednesday October 02, 2019 @06:54AM (#21135051)
From the article:

> ” Such functionality was earlier usually achieved with triggers, but with generated columns this becomes much more elegant and cleaner.”

Re:New In Postgres 12: Generated Columns by ako on Wednesday October 02, 2019 @07:53AM (#21135422)
"much more elegant and cleaner" is a bit of an overstatement in my opinion...
Re:New In Postgres 12: Generated Columns by grzm on Wednesday October 02, 2019 @08:11AM (#21135525)
Sounds like the generated column implementation is faster than a PL/pgSQL trigger.

https://news.ycombinator.com/item?id=21134706

I don’t have a link at hand from a discussion on the mailing list, but I’ll take Peter’s word for it.

Re:New In Postgres 12: Generated Columns by mobilemidget on Wednesday October 02, 2019 @02:59PM (#21139668)
I miss the why its more elegant and cleaner too.

"Indexes: Generated columns can be used in indexes, but cannot be used as a partition key for partitioned tables."

I also hope it can be used for a partition key in the future.