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

From Igor Korot
Subject Re: Postgres do not support tinyint?
Date
Msg-id CA+FnnTyxnWjjaC4dDo6Y4DeCYAVa3dgGdsMg3sdTOFiyHAG7Ag@mail.gmail.com
Whole thread Raw
In response to Re: Postgres do not support tinyint?  (Christophe Pettus <xof@thebuild.com>)
List pgsql-general
Hi, Christopphe,

On Wed, Jan 8, 2025 at 1:34 PM Christophe Pettus <xof@thebuild.com> wrote:
>
>
>
> > On Jan 8, 2025, at 11:30, Igor Korot <ikorot01@gmail.com> wrote:
> > There is no boolean - it is 0-4 inclusive.
>
> Unless you have somehow gotten PostgreSQL running on an IBM 7070, the range 0-4 can be represented by three binary
digits,aka booleans. :-) 

The only booleans I know of are 0 and 1. ;-)

>
> To be serious, though, the situation is:
>
> 1. If there are just one or two tinyints, having a tinyint type wouldn't save any space in the row.

No it is not a lot of them.
So then "smallint" is the best bet, right?

Thank you

> 2. If there are a lot of them, it's worth encoding them into a bitstring.



pgsql-general by date:

Previous
From: Christophe Pettus
Date:
Subject: Re: Postgres do not support tinyint?
Next
From: Adrian Klaver
Date:
Subject: Re: INTERVAL MINUTE TO SECOND didn't do what I thought it would do