Re: Infinite Interval - Mailing list pgsql-hackers

From Joseph Koshakow
Subject Re: Infinite Interval
Date
Msg-id CAAvxfHcuHr3_WB-7v2WdO+Q9Zb4LwE6N0_D5u7VLADhZ0B7JbA@mail.gmail.com
Whole thread Raw
In response to Re: Infinite Interval  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Infinite Interval  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Infinite Interval  (Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>)
List pgsql-hackers


On Sat, Mar 18, 2023 at 3:08 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Joseph Koshakow <koshy44@gmail.com> writes:
>> On Thu, Mar 9, 2023 at 12:42 PM Ashutosh Bapat <ashutosh.bapat.oss@gmail.com>
>> wrote:
>>> There are a lot of these diffs. PG code doesn't leave an extra space
>>> between variable name and *.
>
>> Those appeared from running pg_indent. I've removed them all.
>
> More specifically, those are from running pg_indent with an obsolete
> typedefs list.  Good practice is to fetch an up-to-date list from
> the buildfarm:
>
> curl https://buildfarm.postgresql.org/cgi-bin/typedefs.pl -o .../typedefs.list
>
> and use that.  (If your patch adds any typedefs, you can then add them
> to that list.)  There's been talk of trying harder to keep
> src/tools/pgindent/typedefs.list up to date, but not much has happened
> yet.

I must be doing something wrong because even after doing that I get the
same strange formatting. Specifically from the root directory I ran
  curl https://buildfarm.postgresql.org/cgi-bin/typedefs.pl -o src/tools/pgindent/typedefs.list
  src/tools/pgindent/pgindent src/backend/utils/adt/datetime.c src/include/common/int.h src/backend/utils/adt/timestamp.c src/backend/utils/adt/date.c src/backend/utils/adt/formatting.c src/backend/utils/adt/selfuncs.c src/include/datatype/timestamp.h src/include/utils/timestamp.h

>    The specific issue with float zero is that plus zero and minus zero
>    are distinct concepts with distinct bit patterns, but the IEEE spec
>    says that they compare as equal.  The C standard says about "if":
>
>           [#1] The controlling expression of  an  if  statement  shall
>           have scalar type.
>           [#2]  In  both  forms, the first substatement is executed if
>           the expression compares unequal to 0.  In the else form, the
>           second  substatement  is executed if the expression compares
>           equal to 0.
>
>    so it sure looks to me like a float control expression is valid and
>    minus zero should be treated as "false".  Nonetheless, personally
>    I'd consider this to be poor style and would write "r != 0" or
>    "r != 0.0" rather than depending on that.

Thanks for the info, I've updated the three instances of the check to
be "r != 0.0"

>    BTW, this may already need a rebase over 75bd846b6.

The patches in this email should be rebased over master.

- Joe Koshakow
Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Infinite Interval
Next
From: Pavel Stehule
Date:
Subject: Re: proposal: possibility to read dumped table's name from file