Re: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml. - Mailing list pgsql-docs

From Michael Paquier
Subject Re: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.
Date
Msg-id ZpnLEUUNxy-LP_lY@paquier.xyz
Whole thread Raw
In response to A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.  (日向充 <mitsuru.hinata.5432@gmail.com>)
Responses Re: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.
List pgsql-docs
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.
> - Changed CREATE TABLE tab
>   '(y int, z int)' to '(x int, y int, z int)'
> - Changed INSERT INTO tab
>   '(1, 2), (3, 4), (5, 6), (7, 8)'
>   to '(1, 2, 3), (4, 5, 6), (7, 8, 9), (10, 11, 12)'
> - Changed CREATE FUNCTION sum_n_product_with_tab
>   '(x int, OUT sum int, OUT product int)'
>   to '(int, OUT sum int, OUT product int)'
> - Changed CREATE FUNCTION sum_n_product_with_tab
>   'SELECT $1 + tab.y, $1 * tab.y FROM tab;'
>   to 'SELECT $1 + tab.x, $1 * tab.x FROM tab;'
> - Changed result of "SELECT * FROM sum_n_product_with_tab(10);"
>
> 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.
--
Michael

Attachment

pgsql-docs by date:

Previous
From: 日向充
Date:
Subject: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.
Next
From: "David G. Johnston"
Date:
Subject: Re: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.