Hi all
Thank you for the comments.
On 12/1/26 1:41 PM, Fujii Masao wrote:
> On Tue, Dec 1, 2026 at 11:36 AM Ideriha, Takeshi
> <[email protected]> wrote:
>> The patch attached.
>
> Thanks for the patch! LGTM.
> Barring any objections, I will commit it and backpatch it to v15.
Thanks!
>> Maybe we could remove BrinOpcInfo structure from the
>
> +1 to removing it from the docs in master. I'm not sure how useful
> it is to document this structure. I guess that BRIN developers still
> need to consult the source, e.g., for related types such as BrinDesc
> and TypeCacheEntry anyway, regardless of whether this definition
> is documented.
Thank you for the comment. That's true. I was checking brin.c,
brin_minmax.c and so on while I was developing. I removed BrinOpcInfo
definition from the doc for master branch.
On 12/1/26 2:13 PM, Kirill Reshke wrote:
(I noticed other several things about BRIN also and will send another
patch.)
Are they related to this one? If its all about doc we can commit it in one go
Other things I found are:
1. brin_minmax_multi_consistent() has a dead line of code
I posted in
https://www.postgresql.org/message-id/afc6425d-3f95-4aa0-ae65-e483c93b2436%40gmail.com
2. The doc says API name is unionTuples() but actually it seems union()
is correct according to the implementation such as brin_minmax_union()
or brin_minmax_multi_union(). There is a static function called
union_tuples() in brin.c, which wraps union function.
3. The return value of union() API is defined as bool in the doc and
actual source code such as pg_proc.dat but actual implementation just
returns such as brin_minmax_union() or brin_minmax_multi_union() void.
The caller function in brin.c also does not care return value.
This is harmless issue.
I already posted 1st point in another thread and it seems point 3rd
point needs some discussion including the code. The 2nd point seems very
simple one. So attached the patch for the 2nd point in this thread.
--
Regards,
Takeshi Ideriha
From 4760c9f707b4a89098e6c84cd3af5228e280b07d Mon Sep 17 00:00:00 2001
From: Takeshi Ideriha <[email protected]>
Date: Tue, 1 Dec 2026 14:53:47 +0900
Subject: [PATCH v1] remove BrinOpcInfo defenition from the doc
---
doc/src/sgml/brin.sgml | 15 +--------------
1 file changed, 1 insertion(+), 14 deletions(-)
diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index 64fb520db7e..5f3ff0ad463 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -842,20 +842,7 @@ LOG: request for BRIN range summarization for index
"brin_wi_idx" page 128 was
<para>
Returns internal information about the indexed columns' summary data.
The return value must point to a palloc'd
<structname>BrinOpcInfo</structname>,
- which has this definition:
-<programlisting>
-typedef struct BrinOpcInfo
-{
- /* Number of columns stored in an index column of this opclass */
- uint16 oi_nstored;
-
- /* Opaque pointer for the opclass' private use */
- void *oi_opaque;
-
- /* Type cache entries of the stored columns */
- TypeCacheEntry *oi_typcache[FLEXIBLE_ARRAY_MEMBER];
-} BrinOpcInfo;
-</programlisting>
+ which is defined in
<filename>src/include/access/brin_internal.h</filename>:
<structname>BrinOpcInfo</structname>.<structfield>oi_opaque</structfield> can
be used by the
operator class routines to pass information between support functions
during an index scan.
--
2.54.0 (Apple Git-157)
From c08595628e3e23940c6ebfd1305b8b0d5429ea0e Mon Sep 17 00:00:00 2001
From: Takeshi Ideriha <[email protected]>
Date: Tue, 1 Dec 2026 15:00:56 +0900
Subject: [PATCH v1] union is correct API name
---
doc/src/sgml/brin.sgml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index 5f3ff0ad463..f8dac991c1f 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -891,7 +891,7 @@ LOG: request for BRIN range summarization for index
"brin_wi_idx" page 128 was
</varlistentry>
<varlistentry>
- <term><function>bool unionTuples(BrinDesc *bdesc, BrinValues *a,
+ <term><function>bool union(BrinDesc *bdesc, BrinValues *a,
BrinValues *b)</function></term>
<listitem>
<para>
--
2.54.0 (Apple Git-157)
From ed5156b3e062c9e838b0b3535720bda6508addb1 Mon Sep 17 00:00:00 2001
From: Takeshi Ideriha <[email protected]>
Date: Tue, 1 Dec 2026 08:47:47 +0900
Subject: [PATCH v1] doc: Fix BrinOpcInfo members to match the code
---
doc/src/sgml/brin.sgml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/doc/src/sgml/brin.sgml b/doc/src/sgml/brin.sgml
index 64fb520db7e..8557517961b 100644
--- a/doc/src/sgml/brin.sgml
+++ b/doc/src/sgml/brin.sgml
@@ -849,6 +849,9 @@ typedef struct BrinOpcInfo
/* Number of columns stored in an index column of this opclass */
uint16 oi_nstored;
+ /* Regular processing of NULLs in BrinValues? */
+ bool oi_regular_nulls;
+
/* Opaque pointer for the opclass' private use */
void *oi_opaque;
--
2.54.0 (Apple Git-157)