Enums are not relations but data types as indicated in the first paragraph here: https://www.postgresql.org/docs/current/static/datatype-enum..., and by the related command ‘CREATE TYPE ...’.
Relations are commonly used when referring to tables and views.
What do you gain by calling types relations while introducing confusion and diminishing practicality of the relation concept?
Re:Cost of a Join
by dragonwriter on Wednesday August 15, 2018 @03:49PM
(#17769117)
Finite data types are, or are isomorphic to, (constant) relations, they aren't relvars like tables/views (relations include both constant relations and relvars.)
> What do you gain by calling types relations
The fact that everything true of other relations is true of finite types.
This is TRUE. Most people ignore the relational model despite being so simple to learn. But one important thing to note, is that similar how you can say "anything is a object" you can say "anything is a relation".
This is valid SQL:
And because "1" is a relation, a enum is.Normal rdbms fail at operate to inner values (like the array feature on postgresql) and don't allow to put tables into cells. This is valid at the relational level but you need to do hacky stuff for common rdbms.
I'm working in a relational language, and this will be valid: and