-
Notifications
You must be signed in to change notification settings - Fork 0
Documentation for Enum support #129
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
base: master
Are you sure you want to change the base?
Conversation
a6a5959 to
0f490c4
Compare
b7a8726 to
e5ccdbd
Compare
e5ccdbd to
8cebadd
Compare
| ```sql | ||
| select id from tasks where priority >= 'major'; | ||
| ``` | ||
|
|
||
| ``` | ||
| id | ||
| ---- | ||
| 1 | ||
| 3 | ||
| 4 | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to also list the priority in the result and maybe explain it, e.g.,
select id, priority from tasks where priority >= 'major';id | priority ---- 1 | major 3 | critical 4 | majorID 2 is filtered out because it has priority minor which was added before major and critical.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see where you're coming from.
What do you think of using a much simlper example, like
select 'major'::importance>'minor'::importance;instead? I feel like the slightly more complicated example currently presented in the doc is somewhat more intuitive, but you're right, that it is less self-explanatory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think both is fine. In general the one with the table is probably the more common use case, so I would go with this, but you can also do the other example or add both if you like.
5c9981a to
bd3dfba
Compare
| * Between, between symmetric | ||
| * Bit and (`&`) on [bitsrings](/docs/references/sqlreference/functions/bitstring#bit--bit) | ||
| * Bit or (`|`) on [bitstrings]](/docs/references/sqlreference/functions/bitstring#bit--bit-1) | ||
| * Bit or (`|`) on [bitstrings](/docs/references/sqlreference/functions/bitstring#bit--bit-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're welcome :D
| ### Change ownership | ||
| The owner of an enum can be changed via | ||
| ```sql | ||
| alter type enum_name owner to new_owner; | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am unsure if we should maybe add some info about necessary permissions. Or should we only add this once the permissions are done? @ChrisWint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a previous draft of this page I explained the permissions as such:
This change can only be performed by the current owner or a superuser. The user requires permissions to SET ROLE to the new owner aswell as USAGE on the schema of the enum.
The new owner requires CREATE on the previously mentioned schema.
However, I removed this before opening the PR as I do not describe the required permissions for the other statements either.
features documented: - create type - basic usage - comparison - drop type - alter type add value - alter type owner to
bd3dfba to
c233db2
Compare
With enum support, we need documentation. The docs are held in a very similar style to the postgres docu. Postgres scatters the documentation for some of the related functionality (e.g. drop type) a bit, which I am keeping more closely together.
Also, I am not sure to what extend we want to use running examples throughout the docu or not. I like them, but they arguably are more of a guide, than a documentation.