Re: Postgres do not support tinyint? - Mailing list pgsql-general

From Ron Johnson
Subject Re: Postgres do not support tinyint?
Date
Msg-id CANzqJaCxZK0j8fL-riZpX+AV+kyo9PcAvgF=H5DgaWK+C+66Vw@mail.gmail.com
Whole thread Raw
In response to Postgres do not support tinyint?  (Igor Korot <ikorot01@gmail.com>)
Responses Re: Postgres do not support tinyint?
Re: Postgres do not support tinyint?
List pgsql-general
On Wed, Jan 8, 2025 at 12:06 AM Igor Korot <ikorot01@gmail.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.

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

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Postgres do not support tinyint?
Next
From: Igor Korot
Date:
Subject: Re: Postgres do not support tinyint?