Re: minor doc fix - garbage in example of result of unnest - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: minor doc fix - garbage in example of result of unnest
Date
Msg-id CAKFQuwbD4K1RFCTVw+3B6Ld7AKYZW18m_wQAuTsjwZ2giXexYw@mail.gmail.com
Whole thread Raw
In response to Re: minor doc fix - garbage in example of result of unnest  (Tomas Vondra <tomas.vondra@2ndquadrant.com>)
Responses Re: minor doc fix - garbage in example of result of unnest  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Fri, Jun 5, 2020 at 8:38 AM Tomas Vondra <tomas.vondra@2ndquadrant.com> wrote:
On Fri, Jun 05, 2020 at 09:56:54AM -0400, Tom Lane wrote:
>Pavel Stehule <pavel.stehule@gmail.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.

pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: minor doc fix - garbage in example of result of unnest
Next
From: Alvaro Herrera
Date:
Subject: Re: SIGSEGV from START_REPLICATION 0/XXXXXXX in XLogSendPhysical ()at walsender.c:2762