-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sql: support ENUM types #24873
Comments
This would also be an important building block in query planning for some instances of partitioned tables. Some background on this at https://github.com/cockroachdb/cockroach/blob/2f2cb3af3df0bebf01bd2f0bb9c8329ad44229df/docs/RFCS/20170921_sql_partitioning.md#query-planning-changes |
cc @awoods187 for prioritization |
Split SET into a new issue #27415 |
In which release can we expect this feature? |
It's not planned yet. |
No Enum? that's a show stopper for me. don't understand what makes this simple constraint so difficult to implement. |
Hello Olivier!
Thank you for your feedback! We love external contributions! We also would love to guide you to implement this simple constraint!
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
Thank you. But then.. custom types are also missing, and stored procedure also seem to have their issues. ;-) |
Very excited for this 👍 |
Any updates on this Feature? |
@Y0ngg4n, we're likely to work on it for our 20.2 release, which will be in late 2020. Unfortunately we didn't get to it for 20.1, which is going to be released in the next month or so. |
Hi all -- we're looking into implementing this and are wondering how often the postgres supported behavior of
is used. This syntax adds a new value to an existing enum but affects how it is ordered against other elements in the enum, rather than just ordering it larger than all existing elements. Thanks! |
@rohany I never used ordering within an enum to be honest. |
@rohany A customer of ours is using this feature in newer versions of PostgreSQL. They wrote their own database change management utility that can logically reorder columns in tables as well to make sure every schema on every installation and environment always looks the same. The benefit is when development uses feature branching, and two branches add columns (or enumeration values) in different order, depending on how they're merged and linearised, there are no unwanted and untested side effects due to ordering. I see this as a nice feature from a QA perspective. Yes, it's possible to code all logic to be resilient to ordering changes, but that's a lot of effort, which can be avoided. |
Internally, will they be stored as integers, thus yielding a performance win? Or is the initially goal just to enforce the constraint? |
They won't be integers internally, but we have a separate representation for them that will use only a single byte in most cases! You can read about it here https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/20200331_enums.md#physical-layout. |
Marking this as done! |
Special case of #25123.
Feature request: Postgres supports
ENUM
types for defining columns that can contain only a given set of values. CockroachDB should, too.https://www.postgresql.org/docs/10/static/datatype-enum.html
Special note:
The text was updated successfully, but these errors were encountered: