News for hackers. Stuff that matters.
Re:New In Postgres 12: Generated Columns by dragonwriter on Wednesday October 02, 2019 @10:44AM (#21137000)
> The difference is that I-descriptors were always calculated on the fly and they could do a LOT more than PostgreSQL's generated columns.

So, just like columns in a view.

> These were commonly used to accomplish things that SQL would use a JOIN to do, mainly because the query language didn't have joins.

Yeah, in SQL you could do that with a correlated subquery in a column definition in a view, instead of a join, but it's generally not optimal (I've seen people do it, though not recently.) There's other uses for correlated subqueries besides being the inefficient way to do joins, and they, plus normal functions, let you calculate just about anything you might want in a columns in a view.

> The results of the I-descriptor don't have to be stable - they can be calculated based on the current date/time, random numbers, data in other files, etc. This leads to some interesting possibilities that I don't think PostgreSQL's implementation can touch.

The calculated columns one that supports only immutable functions because the values are materialized which doesn't make sense otherwise can't, but then on-the-fly calculation makes reads expensive. If you need that, though, Postgres supports it in views since (approximately) forever, which are the classic SQL approach to the problem.

Re:New In Postgres 12: Generated Columns by Mister_Snuggles on Wednesday October 02, 2019 @12:05PM (#21137951)
Yes, for the common case a view does the trick.

However, I-Descriptors have the power of the underlying UniVerse BASIC runtime at their disposal, so you can do a LOT of things. I mention one of these in another comment[0].

However, as I mentioned, doing it this way isn't necessarily a good idea.

[0] https://news.ycombinator.com/item?id=21137935

Re:New In Postgres 12: Generated Columns by dragonwriter on Wednesday October 02, 2019 @02:06PM (#21139181)
Postgres views have the power of the installed procedural language runtimes behind them; its pretty common this includes an unrestricted Python interpreter, among others.