pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: 日向充 <mitsuru.hinata.5432@gmail.com>
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.
Date: Fri, 19 Jul 2024 11:10:25 +0900
Message-ID: <ZpnLEUUNxy-LP_lY@paquier.xyz> (raw)
In-Reply-To: <CAF-2iM_9-2a8PijHoHbS6ZFFV=tziOx8TDo4j+YGDAbsTApk4w@mail.gmail.com>
References: <CAF-2iM_9-2a8PijHoHbS6ZFFV=tziOx8TDo4j+YGDAbsTApk4w@mail.gmail.com>

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

Attachments:

  [application/pgp-signature] signature.asc (832B, ../ZpnLEUUNxy-LP_lY@paquier.xyz/2-signature.asc)
  download

view thread (6+ messages)  latest in thread

Message-ID: <ZpnLEUUNxy-LP_lY@paquier.xyz>
Permalink:  ../ZpnLEUUNxy-LP_lY@paquier.xyz/
Also on:    postgresql.org/message-id/ZpnLEUUNxy-LP_lY@paquier.xyz

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-docs@postgresql.org
  Cc: michael@paquier.xyz, mitsuru.hinata.5432@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: A minor bug in the doc of "SQL Functions Returning Sets" in xfunc.sgml.
  In-Reply-To: <ZpnLEUUNxy-LP_lY@paquier.xyz>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox