[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 : https://github.com/rails/rails/pull/39368/files#diff-8b6198b176d2d61083d47d09ae39048cR479

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: https://github.com/rails/rails/pull/39368

8 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.

1 Like