[GENERAL] ENUM type size - Mailing list pgsql-general

From Олег Самойлов
Subject [GENERAL] ENUM type size
Date
Msg-id 1504383787.16950.8.camel@mipt.ru
Whole thread Raw
Responses Re: [GENERAL] ENUM type size  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
May I ask the question here or I must go to the pgsql-hackers?

Why does ENUM type have 4 byte size? In any use cases, that I know,
ENUM 255 values (1 byte) more then enough. And it's only reason for
ENUM, if you need more values then 255 you can create a foreign table
with smallint (or bigger) primary key. And, obviously that table will
be filled by operators or routines, not by a programmer. The only
reason for ENUM is to use for fields with very small set of values, for
instance: sex, day of week, month, etc. And 1 byte size is 4 times
shorter then 4 bytes, especially for big tables.


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [GENERAL] Numeric numbers
Next
From: Олег Самойлов
Date:
Subject: Re: [GENERAL] Numeric numbers