Re: Patch a potential memory leak in describeOneTableDetails()

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
Cc: wliang(at)stu(dot)xidian(dot)edu(dot)cn, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Patch a potential memory leak in describeOneTableDetails()
Date: 2022-02-22 08:59:09
Message-ID: BDE54C55-438C-48E9-B2A3-08EB3A0CBB9F@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 22 Feb 2022, at 07:14, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com> wrote:

> Anyway, don't we use the -ftabstop option flag to silence compiler?
> The warning is contradicting our convention. The attached adds that
> flag.

Isn't this flag contradicting our convention? From the docs section you
reference further down:

"Source code formatting uses 4 column tab spacing, with tabs preserved
(i.e., tabs are not expanded to spaces)."

The -ftabstop option is (to a large extent, not entirely) to warn when tabs and
spaces are mixed creating misleading indentation that the author didn't even
notice due to tabwidth settings? ISTM we are better of getting these warnings
than suppressing them.

> By the way, the doc says that:
>
> https://www.postgresql.org/docs/14/source-format.html
>
>> The text browsing tools more and less can be invoked as:
>> more -x4
>> less -x4
>> to make them show tabs appropriately.
>
> But AFAICS the "more" command on CentOS doesn't have -x options nor
> any option to change tab width and I don't find a document that
> suggests its existence on other platforms.

macOS, FreeBSD and NetBSD both show the less(1) manpage for more(1) which
suggests that more is implemented using less there, and thus supports -x (it
does on macOS). OpenBSD and Solaris more(1) does not show a -x option, but AIX
does have it. Linux in its various flavors doesn't seem to have it.

The section in question was added to our docs 22 years ago, to make it reflect
the current operating systems in use maybe just not mentioning more(1) is the
easiest?:

"The text browsing tool less can be invoked as less -x4 to make it show
tabs appropriately."

Or perhaps remove that section altogether?

--
Daniel Gustafsson https://vmware.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2022-02-22 09:11:21 Re: wrong fds used for refilenodes after pg_upgrade relfilenode changes Reply-To:
Previous Message Kyotaro Horiguchi 2022-02-22 08:44:01 Re: Add checkpoint and redo LSN to LogCheckpointEnd log message