Skip to content

Conversation

@penguincarol
Copy link
Contributor

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.

@penguincarol penguincarol marked this pull request as ready for review January 12, 2026 17:01
@penguincarol penguincarol requested a review from a team January 13, 2026 10:05
Comment on lines 54 to 65
```sql
select id from tasks where priority >= 'major';
```

```
id
----
1
3
4
```
Copy link
Contributor

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 | major

ID 2 is filtered out because it has priority minor which was added before major and critical.

Copy link
Contributor Author

@penguincarol penguincarol Jan 13, 2026

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.

Copy link
Contributor

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.

* 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're welcome :D

Comment on lines +92 to +96
### Change ownership
The owner of an enum can be changed via
```sql
alter type enum_name owner to new_owner;
```
Copy link
Contributor

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

Copy link
Contributor Author

@penguincarol penguincarol Jan 13, 2026

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants