Re: Postgres do not support tinyint?

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Igor Korot <ikorot01(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, 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 19:34:15
Message-ID: 051EB6AC-2395-4EAD-B30C-069FBC01107F@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jan 8, 2025, at 11:30, Igor Korot <ikorot01(at)gmail(dot)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. :-)

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.
2. If there are a lot of them, it's worth encoding them into a bitstring.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Igor Korot 2025-01-08 19:40:38 Re: Postgres do not support tinyint?
Previous Message Igor Korot 2025-01-08 19:30:04 Re: Postgres do not support tinyint?