EquivalenceClass and custom_read_write

Started by Ashutosh Bapat11 months ago3 messages
#1Ashutosh Bapat
ashutosh.bapat.oss@gmail.com

Hi All,
In pathnodes.h
typedef struct EquivalenceClass
{
pg_node_attr(custom_read_write, no_copy_equal, no_read, no_query_jumble)

Because of custom_read_write attribute, I expect _outEquivalenceClass
to be present in outfuncs.c and _readEquivalenceClass to be present in
readfuncs.c. I find the first but not the second. This could be
because _out function is only for debugging and what it writes is
never read back. Should we add a comment in EquivalenceClass prologue
mentioning the same?

--
Best Wishes,
Ashutosh Bapat

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ashutosh Bapat (#1)
Re: EquivalenceClass and custom_read_write

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

In pathnodes.h
typedef struct EquivalenceClass
{
pg_node_attr(custom_read_write, no_copy_equal, no_read, no_query_jumble)

Because of custom_read_write attribute, I expect _outEquivalenceClass
to be present in outfuncs.c and _readEquivalenceClass to be present in
readfuncs.c. I find the first but not the second. This could be
because _out function is only for debugging and what it writes is
never read back. Should we add a comment in EquivalenceClass prologue
mentioning the same?

Doesn't the "no_read" annotation imply exactly that?

regards, tom lane

#3Ashutosh Bapat
ashutosh.bapat.oss@gmail.com
In reply to: Tom Lane (#2)
Re: EquivalenceClass and custom_read_write

On Wed, Feb 12, 2025 at 10:25 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:

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

In pathnodes.h
typedef struct EquivalenceClass
{
pg_node_attr(custom_read_write, no_copy_equal, no_read, no_query_jumble)

Because of custom_read_write attribute, I expect _outEquivalenceClass
to be present in outfuncs.c and _readEquivalenceClass to be present in
readfuncs.c. I find the first but not the second. This could be
because _out function is only for debugging and what it writes is
never read back. Should we add a comment in EquivalenceClass prologue
mentioning the same?

Doesn't the "no_read" annotation imply exactly that?

Oh! I just looked at custom_read_write and missed no_read. Sorry.
Thanks for pointing that out.

--
Best Wishes,
Ashutosh Bapat