On Tue, Oct 18, 2022 at 8:53 AM Dominique Devienne <ddevienne@xxxxxxxxx> wrote:
Hi. I'm surprised by the result for bit(3) and char, when calling
pg_column_size().
Why 6, instead of 1? The doc does mention 5-8 bytes overhead, but I
expected those for varying bit, not fixed-sized bit typed values. How
come?
The base type is what matters, if the length of the actual type is a parameter (the (n) part) the underlying type must be variable, and thus has a component that says how long the actually stored value is.
How does one store as compactedly as possible several small enums, on
millions of rows?
int2
David J.
p.s., pretend char doesn't even exist.