typedef indentation in pg_shmem.h

Started by Ashutosh Bapat8 months ago6 messageshackers
Beta feature

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.

appliessuccessCI history

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:t53071
psql -h localhost -U postgres

Built from patchset v3 (message #3), September 19, 2026 at 02:05 PM.

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 t53071_3 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t53071_3 && git checkout t53071_3

Patchset v3 (message #3) is on t53071_3

Jump to latest
#1Ashutosh Bapat
ashutosh.bapat.oss@gmail.com

Hi Heikki, Thomas,

The typedefs PGShmemType and HugePagesType are not indented properly.
That's because those entries are missing from typedefs list. Is that
intentional? Here's tiny patch fixing the indentation and typedefs
list.

--
Best Wishes,
Ashutosh Bapat

Attachments:

v20260112-0001-Indentation-of-PGShmemType-and-HugePagesTy.patchtext/x-patch; charset=US-ASCII; name=v20260112-0001-Indentation-of-PGShmemType-and-HugePagesTy.patchDownload+4-3
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ashutosh Bapat (#1)
Re: typedef indentation in pg_shmem.h

Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> writes:

The typedefs PGShmemType and HugePagesType are not indented properly.
That's because those entries are missing from typedefs list. Is that
intentional?

The reason this happens is that the automatic process for collecting
typedefs in the buildfarm only picks up typedef names that are used
to declare objects (variables, struct fields, function parameters or
results).

AFAICS neither of these typedef names are referenced at all, anywhere.

Here's tiny patch fixing the indentation and typedefs
list.

I don't think this is helpful, because that change will just get
undone the next time we absorb the buildfarm's list. (And to be
clear, I consider the buildfarm's list to be the canonical one.)

I think the right way is to remove the unused typedefs, that is
along the lines of

-typedef enum
+enum HugePagesType
 {
...
-}			HugePagesType;
+};

We can put them back when/if there's a reason to use them.

regards, tom lane

#3Ashutosh Bapat
ashutosh.bapat.oss@gmail.com
In reply to: Tom Lane (#2)
Re: typedef indentation in pg_shmem.h

Hi Tom,

On Mon, Jan 12, 2026 at 8:32 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> writes:

The typedefs PGShmemType and HugePagesType are not indented properly.
That's because those entries are missing from typedefs list. Is that
intentional?

The reason this happens is that the automatic process for collecting
typedefs in the buildfarm only picks up typedef names that are used
to declare objects (variables, struct fields, function parameters or
results).

AFAICS neither of these typedef names are referenced at all, anywhere.

Here's tiny patch fixing the indentation and typedefs
list.

I don't think this is helpful, because that change will just get
undone the next time we absorb the buildfarm's list. (And to be
clear, I consider the buildfarm's list to be the canonical one.)

I think the right way is to remove the unused typedefs, that is
along the lines of

-typedef enum
+enum HugePagesType
{
...
-}                      HugePagesType;
+};

We can put them back when/if there's a reason to use them.

Thanks for your corrections. Your idea works, the changes survive
pgindent run. PFA patch.

--
Best Wishes,
Ashutosh Bapat

Attachments:

t53071_3
v20260112-0001-Fix-PGShmemType-and-HugePagesType-typedefs.patchtext/x-patch; charset=US-ASCII; name=v20260112-0001-Fix-PGShmemType-and-HugePagesType-typedefs.patchDownload+4-5
#4zengman
zengman@halodbtech.com
In reply to: Ashutosh Bapat (#3)
Re: typedef indentation in pg_shmem.h

The typedefs PGShmemType and HugePagesType are not indented properly.
That's because those entries are missing from typedefs list. Is that
intentional? Here's tiny patch fixing the indentation and typedefs
list.

Hi all,

I just came across this email and wanted to chime in: it appears that a number of types in the kernel have in fact been omitted from the typedefs.list, and it’s likely they were overlooked. For example:
```
BTParallelScanDescData
AfterTriggerEventDataNoOids
AfterTriggerEventDataOneCtid
AfterTriggerEventDataZeroCtids
PartitionDispatchData
MergeJoinClauseData
BufferAccessStrategyData
lwlock_stats_key
lwlock_stats
SerialControlData
AllocBlockData
```
I’m wondering if it’s worth addressing these.

--
Regards,
Man Zeng
www.openhalo.org

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: zengman (#4)
Re: typedef indentation in pg_shmem.h

"=?gb18030?B?emVuZ21hbg==?=" <zengman@halodbtech.com> writes:

I just came across this email and wanted to chime in: it appears that a number of types in the kernel have in fact been omitted from the typedefs.list, and it¡¯s likely they were overlooked. For example:
BTParallelScanDescData
AfterTriggerEventDataNoOids
AfterTriggerEventDataOneCtid
AfterTriggerEventDataZeroCtids
PartitionDispatchData
MergeJoinClauseData
BufferAccessStrategyData
lwlock_stats_key
lwlock_stats
SerialControlData
AllocBlockData

Did you read my reply?

regards, tom lane

#6zengman
zengman@halodbtech.com
In reply to: Tom Lane (#5)
Re: typedef indentation in pg_shmem.h

Did you read my reply?

Hi Tom,

Oh wow, I’ve re-read your previous message carefully, and I realize I overlooked or misunderstood it earlier.
Sorry for the interruption.

--
Regards,
Man Zeng
www.openhalo.org