Search Postgresql Archives

Re: ENUM type size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



=?UTF-8?Q?=D0=9E=D0=BB=D0=B5=D0=B3_?= =?UTF-8?Q?=D0=A1=D0=B0=D0=BC=D0=BE=D0=B9=D0=BB=D0=BE=D0=B2?= <olleg@xxxxxxx> writes:
> May I ask the question here or I must go to the pgsql-hackers?
> Why does ENUM type have 4 byte size?

Because it's really an OID under the hood.

> In any use cases, that I know,
> ENUM 255 values (1 byte) more then enough.

Only if you consider each enum type in isolation (and even then, I'd
dispute your argument that nobody has use for more than 255 values).
In our implementation, enum types are essentially all foreign keys into
the same pg_enum catalog, so you definitely need more space.

Other ways of doing it would have created problems of their own.  But
you can certainly build your own enum type if you don't like the tradeoffs
the core code made.

			regards, tom lane


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux