Re: Fixed a typo in comment in compress_lz4.c - Mailing list pgsql-hackers

From Chao Li
Subject Re: Fixed a typo in comment in compress_lz4.c
Date
Msg-id 8F6FDD49-482C-4A7A-83FE-C5C0A19E989F@gmail.com
Whole thread Raw
In response to Re: Fixed a typo in comment in compress_lz4.c  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Fixed a typo in comment in compress_lz4.c
List pgsql-hackers


On Oct 14, 2025, at 07:32, Michael Paquier <michael@paquier.xyz> wrote:

On Mon, Oct 13, 2025 at 06:08:43PM -0400, Tom Lane wrote:
I disagree that it's not widely known.  OneLook Dictionary Search [1]
defines it correctly as "Usually means: If and only if; equivalence"
and reports finding it in 35 of their underlying dictionaries,
including all the usual suspects.  (Some of the 35 know the military
term "IFF: Identification Friend or Foe" rather than what we're
after, but still that's plenty of hits.)

I wonder whether adding it to our glossary would be helpful.

I think it would, it's not the first time somebody is confused by
this abbreviation.  At least we would have an official reference in
the tree to be able to point to, and this term is used even by
non-native English-speaking committers (like myself) in comments,
sometimes.

(French has a version of that: "si et seulement si" or "ssi", that
I've used and seen a lot, bit only when dealing with theory in maths
or physics.)
--
Michael

I wonder when “if and only if” should be used.

Look at this instance. The comment says:

  * LZ4 equivalent to feof() or gzeof().  Return true iff there is no
  * more buffered data and the end of the input file has been reached.

It just states when the function should return true. In this case, why “if” is not good enough and “if and only if” is needed?

Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/




pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Incorrect version number given to sync_pgdata() in pg_combinebackup.c
Next
From: Tatsuo Ishii
Date:
Subject: Re: Add RESPECT/IGNORE NULLS and FROM FIRST/LAST options