Re: Postgres do not support tinyint?

From: Igor Korot <ikorot01(at)gmail(dot)com>
To: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Postgres do not support tinyint?
Date: 2025-01-08 06:26:32
Message-ID: CA+FnnTz6GK0rKuC+g+LH25-N75ej-WGq7WZ1kpQZ9gtSbDeA+g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi, Ron,

On Tue, Jan 7, 2025 at 11:24 PM Ron Johnson <ronljohnsonjr(at)gmail(dot)com> wrote:
>
> On Wed, Jan 8, 2025 at 12:06 AM Igor Korot <ikorot01(at)gmail(dot)com> wrote:
>>
>> Hi, ALL,
>> According to https://www.postgresql.org/docs/9.1/datatype-numeric.html, the
>> smallest numeric type supports numbers from -32768 to 32767/
>>
>> My data will be in a range of [0..4], and so I guess my DB table will waste
>> space, right?
>
>
> 1. It's not 1994 anymore, when 8M rows was enormous.
> 2. Record structures are padded by word size, so tinyint wouldn't matter unless you specifically ordered the fixed width columns from largest to smallest size when creating the table.
> 3. The "bit" type might serve your needs.

I don't see the "bit" field here:
https://www.postgresql.org/docs/current/datatype-numeric.html...

Thank you..

>
> --
> Death to <Redacted>, and butter sauce.
> Don't boil me, I'm still alive.
> <Redacted> lobster!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christophe Pettus 2025-01-08 06:28:14 Re: Postgres do not support tinyint?
Previous Message Ron Johnson 2025-01-08 05:24:21 Re: Postgres do not support tinyint?