News for hackers. Stuff that matters.
Re:Representing Enums in PostgreSQL by jensenbox on Tuesday June 20, 2023 @11:27AM (#36405402)
What is the difference in size on disk between the two options?
Re:Representing Enums in PostgreSQL by jpmelos on Tuesday June 20, 2023 @01:47PM (#36407712)
An enum stores a small reference to the enum value in the tuples, and the constraint approach stores the string itself. The constraint approach takes more space with (a) larger enum values, (b) more columns using them, and (c) more rows in the tables that use them. The difference depends on the characteristics of the database we're talking about.