simplify index tuple descriptor initialization
Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.
You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:
docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t39261psql -h localhost -U postgresBuilt from patchset v1 (message #1), July 28, 2026 at 05:18 AM.
Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:
git clone --branch t39261_1 https://github.com/hackorum-dev/postgres.gitIn a checkout you already have, add the fork once:
git remote add hackorum https://github.com/hackorum-dev/postgres.gitthen, for this patchset and every later one:
git fetch hackorum t39261_1 && git checkout t39261_1Patchset v1 (message #1) is on t39261_1
Whenever some pg_attribute field is added or changed, a lot of
repetitive changes all over the code are necessary. Here is a small
change to remove one such place.
We have two code paths for initializing the tuple descriptor for a new
index: For a normal index, we copy the tuple descriptor from the table
and reset a number of fields that are not applicable to indexes. For an
expression index, we make a blank tuple descriptor and fill in the
needed fields based on the provided expressions. As pg_attribute has
grown over time, the number of fields that we need to reset in the first
case is now bigger than the number of fields we actually want to copy,
so it's sensible to do it the other way around: Make a blank descriptor
and copy just the fields we need. This also allows more code sharing
between the two branches, and it avoids having to touch this code for
almost every unrelated change to the pg_attribute structure.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
On Mon, Aug 27, 2018 at 04:25:28PM +0200, Peter Eisentraut wrote:
Whenever some pg_attribute field is added or changed, a lot of
repetitive changes all over the code are necessary. Here is a small
change to remove one such place.
It looks like a reasonable change to me.
The code is good and regression tests passed. There is no need to update
the documentation.
Marked as Ready for Commiter.
--
Arthur Zakirov
Postgres Professional: http://www.postgrespro.com
Russian Postgres Company
On 12/09/2018 15:18, Arthur Zakirov wrote:
On Mon, Aug 27, 2018 at 04:25:28PM +0200, Peter Eisentraut wrote:
Whenever some pg_attribute field is added or changed, a lot of
repetitive changes all over the code are necessary. Here is a small
change to remove one such place.It looks like a reasonable change to me.
The code is good and regression tests passed. There is no need to update
the documentation.Marked as Ready for Commiter.
Committed, thanks.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services