Fix wrong filename in header comment of gin_tuple.h
Hi Hacker,
When gin_tuple.h was introduced by commit 8492feb[1]https://git.postgresql.org/cgit/postgresql.git/commit/?id=8492feb98f6df3f0f03e84ed56f0d1cbb2ac514c, the file header
comment incorrectly referred to gin.h. Update the comment to mention
gin_tuple.h instead.
[1]: https://git.postgresql.org/cgit/postgresql.git/commit/?id=8492feb98f6df3f0f03e84ed56f0d1cbb2ac514c
https://git.postgresql.org/cgit/postgresql.git/commit/?id=8492feb98f6df3f0f03e84ed56f0d1cbb2ac514c
Best regards,
Chao Li (Evan)
---------------------
HighGo Software Co., Ltd.
https://www.highgo.com/
Attachments:
v1-0001-Fix-wrong-filename-in-header-comment-of-gin_tuple.patchapplication/octet-stream; name=v1-0001-Fix-wrong-filename-in-header-comment-of-gin_tuple.patchDownload
From e3a569c55b4273c299ed7933b84e41d2f23d4c3e Mon Sep 17 00:00:00 2001
From: "Chao Li (Evan)" <lic@highgo.com>
Date: Mon, 22 Sep 2025 07:02:03 +0800
Subject: [PATCH v1] Fix wrong filename in header comment of gin_tuple.h
When gin_tuple.h was introduced by commit 8492feb, the file header
comment incorrectly referred to gin.h. Update the comment to mention
gin_tuple.h instead.
Author: Chao Li <lic@highgo.com>
---
src/include/access/gin_tuple.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/include/access/gin_tuple.h b/src/include/access/gin_tuple.h
index b4f103dec9a..15d39226dde 100644
--- a/src/include/access/gin_tuple.h
+++ b/src/include/access/gin_tuple.h
@@ -1,10 +1,10 @@
/*--------------------------------------------------------------------------
- * gin.h
+ * gin_tuple.h
* Public header file for Generalized Inverted Index access method.
*
* Copyright (c) 2006-2025, PostgreSQL Global Development Group
*
- * src/include/access/gin.h
+ * src/include/access/gin_tuple.h
*--------------------------------------------------------------------------
*/
#ifndef GIN_TUPLE_H
--
2.39.5 (Apple Git-154)
On Mon, Sep 22, 2025 at 8:10 AM Chao Li <li.evan.chao@gmail.com> wrote:
When gin_tuple.h was introduced by commit 8492feb[1], the file header comment incorrectly referred to gin.h. Update the comment to mention gin_tuple.h instead.
Indeed. Will push the patch.
- Richard
On Mon, 22 Sept 2025 at 11:59, Richard Guo <guofenglinux@gmail.com> wrote:
On Mon, Sep 22, 2025 at 8:10 AM Chao Li <li.evan.chao@gmail.com> wrote:
When gin_tuple.h was introduced by commit 8492feb[1], the file header comment incorrectly referred to gin.h. Update the comment to mention gin_tuple.h instead.
Indeed. Will push the patch.
I was just working on a script to find others and it highlighted a
bunch more. Do you still want to do this one, or should I take them
all in one fell swoop?
David
On Mon, Sep 22, 2025 at 9:53 AM David Rowley <dgrowleyml@gmail.com> wrote:
On Mon, 22 Sept 2025 at 11:59, Richard Guo <guofenglinux@gmail.com> wrote:
On Mon, Sep 22, 2025 at 8:10 AM Chao Li <li.evan.chao@gmail.com> wrote:
When gin_tuple.h was introduced by commit 8492feb[1], the file header comment incorrectly referred to gin.h. Update the comment to mention gin_tuple.h instead.
Indeed. Will push the patch.
I was just working on a script to find others and it highlighted a
bunch more. Do you still want to do this one, or should I take them
all in one fell swoop?
Makes sense to handle them all together. Feel free to take this one
as part of the larger cleanup.
- Richard
On Mon, 22 Sept 2025 at 12:57, Richard Guo <guofenglinux@gmail.com> wrote:
On Mon, Sep 22, 2025 at 9:53 AM David Rowley <dgrowleyml@gmail.com> wrote:
I was just working on a script to find others and it highlighted a
bunch more. Do you still want to do this one, or should I take them
all in one fell swoop?Makes sense to handle them all together. Feel free to take this one
as part of the larger cleanup.
Thanks.
"script" didn't amount to much more than running:
git grep "^\s\*\s.*\.[ch]$" -- *.[ch] | sed -r "s/ \*\s{1,}(.*)/\1/"
and then filtering every line where the text left of the ':' didn't
end in the text right of the ':'. There are about 287 lines out of
4302 lines that don't match that. So a quick eyeball scan of the 287
lines seemed to work to check for abnormalities. Almost all of the
remainder are just mentioning a filename in a sentence rather than for
the identification related stuff.
Pushed the found abnormalities, which included Chao's
David
I quickly created a Python script and captured one more in
rewrite/rowsecurity.c. The file put filename reference in a different
format than other files:
```
diff --git a/src/backend/rewrite/rowsecurity.c
b/src/backend/rewrite/rowsecurity.c
index 4dad384d04d..3d6b6ba177b 100644
--- a/src/backend/rewrite/rowsecurity.c
+++ b/src/backend/rewrite/rowsecurity.c
@@ -1,5 +1,5 @@
/*
- * rewrite/rowsecurity.c
+ * rowsecurity.c
* Routines to support policies for row-level security (aka RLS).
*
* Policies in PostgreSQL provide a mechanism to limit what records are
@@ -31,6 +31,9 @@
*
* Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * IDENTIFICATION
+ * src/backend/rewrite/rowsecurity.c
*/
```
Please see if this one should be fixed as well. Attached is the patch file
as shown above.
Chao Li (Evan)
---------------------
HighGo Software Co., Ltd.
https://www.highgo.com/
On Mon, Sep 22, 2025 at 9:42 AM David Rowley <dgrowleyml@gmail.com> wrote:
Show quoted text
On Mon, 22 Sept 2025 at 12:57, Richard Guo <guofenglinux@gmail.com> wrote:
On Mon, Sep 22, 2025 at 9:53 AM David Rowley <dgrowleyml@gmail.com>
wrote:
I was just working on a script to find others and it highlighted a
bunch more. Do you still want to do this one, or should I take them
all in one fell swoop?Makes sense to handle them all together. Feel free to take this one
as part of the larger cleanup.Thanks.
"script" didn't amount to much more than running:
git grep "^\s\*\s.*\.[ch]$" -- *.[ch] | sed -r "s/ \*\s{1,}(.*)/\1/"
and then filtering every line where the text left of the ':' didn't
end in the text right of the ':'. There are about 287 lines out of
4302 lines that don't match that. So a quick eyeball scan of the 287
lines seemed to work to check for abnormalities. Almost all of the
remainder are just mentioning a filename in a sentence rather than for
the identification related stuff.Pushed the found abnormalities, which included Chao's
David
Attachments:
v1-0001-Fix-incorrect-filename-reference-in-rewrite-rowse.patchapplication/octet-stream; name=v1-0001-Fix-incorrect-filename-reference-in-rewrite-rowse.patchDownload
From 7aeb51e73e40ca5e15e01267a55b9cbb0b61263f Mon Sep 17 00:00:00 2001
From: "Chao Li (Evan)" <lic@highgo.com>
Date: Mon, 22 Sep 2025 10:30:43 +0800
Subject: [PATCH v1] Fix incorrect filename reference in rewrite/rowsecurity.c
Author: Chao Li <lic@highgo.com>
---
src/backend/rewrite/rowsecurity.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/backend/rewrite/rowsecurity.c b/src/backend/rewrite/rowsecurity.c
index 4dad384d04d..3d6b6ba177b 100644
--- a/src/backend/rewrite/rowsecurity.c
+++ b/src/backend/rewrite/rowsecurity.c
@@ -1,5 +1,5 @@
/*
- * rewrite/rowsecurity.c
+ * rowsecurity.c
* Routines to support policies for row-level security (aka RLS).
*
* Policies in PostgreSQL provide a mechanism to limit what records are
@@ -31,6 +31,9 @@
*
* Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * IDENTIFICATION
+ * src/backend/rewrite/rowsecurity.c
*/
#include "postgres.h"
--
2.39.5 (Apple Git-154)
On Mon, 22 Sept 2025 at 14:46, Chao Li <li.evan.chao@gmail.com> wrote:
diff --git a/src/backend/rewrite/rowsecurity.c b/src/backend/rewrite/rowsecurity.c
- * rewrite/rowsecurity.c + * rowsecurity.c
+ * + * IDENTIFICATION + * src/backend/rewrite/rowsecurity.c
I don't what's incorrect with these as I'm not aware of the rule that
the IDENTIFICATION must exist or that the filename must be the
filename only without any of the path. Plenty of other files don't
have the identification text, so not sure why your script only picked
up on rowsecurity.c.
It maybe would make more sense if you posted the script, or
highlighted why rowsecurity.c is special out of all the files that
don't contain an "IDENTIFICATION".
Also, I'm not interested in making any large churn here for stylistic
reasons. I think that would end up as a huge patch for no measurable
gains.
David
On Sep 23, 2025, at 04:02, David Rowley <dgrowleyml@gmail.com> wrote:
On Mon, 22 Sept 2025 at 14:46, Chao Li <li.evan.chao@gmail.com> wrote:
diff --git a/src/backend/rewrite/rowsecurity.c b/src/backend/rewrite/rowsecurity.c- * rewrite/rowsecurity.c + * rowsecurity.c+ * + * IDENTIFICATION + * src/backend/rewrite/rowsecurity.cI don't what's incorrect with these as I'm not aware of the rule that
the IDENTIFICATION must exist or that the filename must be the
filename only without any of the path. Plenty of other files don't
have the identification text, so not sure why your script only picked
up on rowsecurity.c.
I see a lot of files don’t have “IDENTIFICATION”, the main problem is the filename that contains one level of parent path.
My script just scan all .c and .h files and extract one-line filename and file path from header comments. If they don’t equal to either pure filename or file path relative to repo root, then capture it. And rowsecurity.c was the only capture, so I thought the filename part (“rewrite/rowsecurity.c) was a problem. When I made the fix, I added “IDENTIFICATION” because I saw a lot of other files having it, but my script didn’t check “IDENTIFICATION”.
I don’t insist to push this patch if you don’t consider the filename part is a problem.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
On Tue, 23 Sept 2025 at 10:21, Chao Li <li.evan.chao@gmail.com> wrote:
My script just scan all .c and .h files and extract one-line filename and file path from header comments. If they don’t equal to either pure filename or file path relative to repo root, then capture it. And rowsecurity.c was the only capture, so I thought the filename part (“rewrite/rowsecurity.c) was a problem. When I made the fix, I added “IDENTIFICATION” because I saw a lot of other files having it, but my script didn’t check “IDENTIFICATION”.
Thanks for explaining that.
I don’t insist to push this patch if you don’t consider the filename part is a problem.
I don't, personally. But will defer to anyone who thinks it's more of
an issue than I do.
David