I am using Entity Framework Code with Code First development approach and a PostgreSQL Database. One of my classes has a enum property. This works out quite well.
However, when I took a look at the database I noticed that in the database the enum was actually stored as an integer, not as an enum as I had expected. So if you now directly query data from the database, you only see the integer and you have no clue what it means.
I have seen here and here that you can use a lookup table or store the enum as string to circumvent this, but this seems a bit unnatural IMHO, considering that you could also just could store the enum in the database.
So is there any way to store enums as enum datatype in the database? If no, why not?