[ActiveRecord] [PostgreSQL] Support for generated (virtual) columns

Hello!

I’d like to ask about adding support for generated columns to PostgreSQL adapter in AR. They are supported since version 12 od PostgreSQL: PostgreSQL: Documentation: 12: 5.3. Generated Columns

I think it would be worthy addition without much cost:

  1. API is there - virtual columns exist for MySQL adapter
  2. It does not introduce breaking changes
  3. It allows very nice implementation of the full text search in Postgres. See updated guides in PR#39368 : Add support for generated columns in PostgreSQL by fanfilmu · Pull Request #39368 · rails/rails · GitHub

I actually went ahead and implemented it without writing here, which is not the process, as I later learned - my bad!

Please let me know if the idea/implementation is sound! Here’s the regular link to the PR: Add support for generated columns in PostgreSQL by fanfilmu · Pull Request #39368 · rails/rails · GitHub

6 Likes

I’d personally be happy to see this as well, as it specifically relates to one of the frustrations I outlined in my May of WTFs post.

2 Likes