Add support for generated columns in PostgreSQL (Redux) by MSNexploder · Pull Re...
source link: https://github.com/rails/rails/pull/41856
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
New issue
Add support for generated columns in PostgreSQL (Redux) #41856
Conversation
if options[:stored]
sql << " STORED"
else
raise ArgumentError, <<~MSG
This is the only place where I disagree with some of the given feedback regarding future proofing (e.g. #39368 (comment)). In PostgreSQL 14 there is still no VIRTUAL
support planed.
In my opinion it's better to provide a precise error message rather than adding support for something that may not happen anytime soon (and maybe even create incorrect SQL statements in the process).
Note: This only affects migration support. Reading any type of virtual column is supported.
force-pushed the virtual-columns
branch
3 times, most recently
from
6e1b337
to
4233c97
5 months ago
force-pushed the virtual-columns
branch
2 times, most recently
from
89d5577
to
249e327
5 months ago
Any chances that this PR could fix this issue? #42469
Yeah, with time marching on, I'm feeling more inclined towards the current implementation's conservatism: Postgres will presumably implement virtual columns at some point in the future, but our ability to predict exactly what that'll look like is limited. Better to make support available for the existing feature, and leave an attempt to use the still-theoretical future behaviour to fail in a clear way (which is no better or worse than how it would already fail today if we continue to not ship this PR).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
No reviews
No one assigned
None yet
No milestone
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK