Re: Postgres do not support tinyint?

From: Vladlen Popolitov <v(dot)popolitov(at)postgrespro(dot)ru>
To: Dominique Devienne <ddevienne(at)gmail(dot)com>
Cc: Igor Korot <ikorot01(at)gmail(dot)com>, Christophe Pettus <xof(at)thebuild(dot)com>, "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-10 15:04:51
Message-ID: 81bde2a02f6fee0bab8253a3118e19ad@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Dominique Devienne писал(а) 2025-01-10 16:41:
> On Fri, Jan 10, 2025 at 10:13 AM Vladlen Popolitov
> <v(dot)popolitov(at)postgrespro(dot)ru> wrote:
>> If you really need 1-byte integer, you can use "char" type. Cast it
>> to/from int. See comment at the end of the page
>> https://www.postgresql.org/docs/17/datatype-character.html
>
> Hi. What would be the best online doc to learn about the physical
> storage / format for rows/pages/btree, etc... To understand alignment,
> packing, varint or not, all those things. I'm quite familiar with the
> [SQLite format][1], having read that doc dozens of times, and I'd like
> a better low-level understanding for PostgreSQL as well. TIA, --DD
>
> [1]: https://www.sqlite.org/fileformat.html

I would recommend "PostgreSQL Internals" of Egor Rogov (Chapter 3 about
tuples,
other chapters also great)
Free download from https://postgrespro.com/community/books/internals

Also PostgreSQL source code is officially the part of the documentation.
It is not joke. PostgreSQL source has clear comments in functions code
and in structure declarations. You can compare with other sources, it is
hard to find better
comments made with love.

Heap tuple information is in source file
src/include/access/htup_details.h (HeapTupleHeaderData
structure), but I recommend to read above book first, it simplier
explains many
internal concepts.
--
Best regards,

Vladlen Popolitov.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erik Wienhold 2025-01-10 17:35:38 Re: Display Bytea field
Previous Message Ron Johnson 2025-01-10 14:39:10 Re: Display Bytea field