Re: Lots of incorrect comments in nodeFuncs.c

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Developers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Lots of incorrect comments in nodeFuncs.c
Date: 2021-04-09 04:29:00
Message-ID: CAApHDvoF2d9nkbcmAoD8y9TUHPEaK4ekaZVQ_mn+R-0O4bEEUg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 9 Apr 2021 at 13:52, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Thu, Apr 08, 2021 at 09:21:30PM -0400, Alvaro Herrera wrote:
> > On 2021-Apr-08, Tom Lane wrote:
> >> Maybe like
> >>
> >> case T_ScalarArrayOpExpr:
> >> /* ScalarArrayOpExpr's result is boolean ... */
> >> coll = InvalidOid; /* ... so it has no collation */
> >> break;
> >
> > This is much clearer, yeah.
>
> +1.

Yeah, that's much better.

For the exprSetCollation case, I ended up with:

case T_ScalarArrayOpExpr:
/* ScalarArrayOpExpr's result is boolean ... */
Assert(!OidIsValid(collation)); /* ... so never
set a collation */

I wanted something more like /* ... so we must never set a collation
*/ but that put the line longer than 80. I thought wrapping to a 2nd
line was excessive, so I shortened it to that.

David

Attachment Content-Type Size
improve_possibly_misleading_comments_in_nodefuncs.patch application/octet-stream 7.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bharath Rupireddy 2021-04-09 04:54:58 Re: Simplify backend terminate and wait logic in postgres_fdw test
Previous Message Justin Pryzby 2021-04-09 04:28:52 Re: missing documentation for streaming in-progress transactions