Re: minor doc fix - garbage in example of result of unnest

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: minor doc fix - garbage in example of result of unnest
Date: 2020-06-05 15:49:46
Message-ID: CAKFQuwbD4K1RFCTVw+3B6Ld7AKYZW18m_wQAuTsjwZ2giXexYw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jun 5, 2020 at 8:38 AM Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com>
wrote:

> On Fri, Jun 05, 2020 at 09:56:54AM -0400, Tom Lane wrote:
> >Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> writes:
> >> diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
> >> index 7c06afd3ea..3b810c0eb4 100644
> >> --- a/doc/src/sgml/func.sgml
> >> +++ b/doc/src/sgml/func.sgml
> >> @@ -17821,7 +17821,6 @@ SELECT NULLIF(value, '(none)') ...
> >> 1
> >> 2
> >> </programlisting>
> >> - (2 rows in result)
> >> </para></entry>
> >> </row>
> >
> >That's not "garbage", I put it there intentionally.
> >
>
> Why is it outside the <programlisting> though? Also, the next unnest
> example does not include the number of rows - why the difference?
>

More generally I think the final unnest listing is probably the best
presentation for a set-returning function, and the one under discussion
should be consistent with it. The function reference documentation doesn't
seem like a place to introduce strictly psql output variations like /pset
footer on|off. A set-returning function should be displayed in the example
output as a structured table like the last unnest example. I don't think
it's necessary for "single column" sets to be an exception. Since the
examples convert null to (none) there isn't even whitespace concerns in the
output where you want to display a bottom boundary for clarity.

Related, It seems arbitrary that the case-related full block examples do
not have row counts but the aggregate full block examples do.

I don't see where having the row counts in the output adds clarity and it
just more text for the reader to mentally filter out.

David J.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2020-06-05 15:51:48 Re: SIGSEGV from START_REPLICATION 0/XXXXXXX in XLogSendPhysical () at walsender.c:2762
Previous Message Tomas Vondra 2020-06-05 15:38:11 Re: minor doc fix - garbage in example of result of unnest