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

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: 日向充 <mitsuru(dot)hinata(dot)5432(at)gmail(dot)com>
Cc: 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 02:10:25
Message-ID: ZpnLEUUNxy-LP_lY@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message David G. Johnston 2024-07-19 03:55:40 Re: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.
Previous Message 日向充 2024-07-19 01:46:04 A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.