Re: Patch a potential memory leak in describeOneTableDetails()

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: daniel(at)yesql(dot)se
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-24 05:44:56
Message-ID: 20220224.144456.649565959713198223.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Tue, 22 Feb 2022 09:59:09 +0100, Daniel Gustafsson <daniel(at)yesql(dot)se> wrote in
> > 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)."

Ugg. Right.

> 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.

At Tue, 22 Feb 2022 10:00:46 -0500, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote in
> No, we use pgindent to not have such inconsistent indentation.

Understood. Thaks for clarification.

> > 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.

Thanks for the explanation.

> 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?

I think the former is better.

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Etsuro Fujita 2022-02-24 05:49:12 Re: postgres_fdw: commit remote (sub)transactions in parallel during pre-commit
Previous Message Kyotaro Horiguchi 2022-02-24 05:13:49 Re: remove more archiving overhead