Re: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: 日向充 <mitsuru(dot)hinata(dot)5432(at)gmail(dot)com>, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.
Date: 2024-07-19 03:55:40
Message-ID: CAKFQuwa3nNETFm23VjbX+2=aaBK7Am5Q0ZE3OsBXvYLorLw+Mg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Thu, Jul 18, 2024 at 7:10 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> On Fri, Jul 19, 2024 at 10:46:04AM +0900, 日向充 wrote:
> > I have found executable examples that do not work correctly
> > in the doc of "SQL Functions Returning Sets" in xfunc.sgml.
> > So I fixed the examples as follows.
>
>
The attached patch is much more readable...

>
> > The above will improve the results of examples as follows in this
> chapter.
> >
> > Do you think?
>
> Not sure that this is worth changing. The examples work OK when taken
> in isolation or are able to demonstrate the point they want to show.
> In short, not all these queries are here to be compatible with the
> contents in the same area. See for example the case of the "nodes"
> table on the same page, created nowhere. "tab" is just a more generic
> table name that's more spread.
>
>
Clearly this page repeatedly expects tab.x to exist; and for these queries
to be executable. This seems like the least invasive way to make that
expectation reality. The extremely limited extent of nodes compared to tab
on this page doesn't support using it as a reason to not make the tab
examples work. If anything we should add a create table for nodes for the
reader like we did for tab.

I'd fixup [1] as to match, removing the name of the input parameter "x"
since we use $1 anyway. Getting rid of that now obsolete construction is a
whole other patch.

https://www.postgresql.org/docs/devel/xfunc-sql.html#XFUNC-SQL-FUNCTIONS-RETURNING-TABLE

David J.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2024-07-19 04:05:24 Re: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.
Previous Message Michael Paquier 2024-07-19 02:10:25 Re: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.