Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLaif-000CgN-H5 for pgsql-docs@arkaria.postgresql.org; Tue, 18 Jul 2023 02:45:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qLaid-002Z8U-PN for pgsql-docs@arkaria.postgresql.org; Tue, 18 Jul 2023 02:45:43 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLaid-002Z8H-FV for pgsql-docs@lists.postgresql.org; Tue, 18 Jul 2023 02:45:43 +0000 Received: from mail-yw1-x1136.google.com ([2607:f8b0:4864:20::1136]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qLaiW-0002ia-RK for pgsql-docs@lists.postgresql.org; Tue, 18 Jul 2023 02:45:40 +0000 Received: by mail-yw1-x1136.google.com with SMTP id 00721157ae682-579e5d54e68so56176857b3.1 for ; Mon, 17 Jul 2023 19:45:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689648336; x=1690253136; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=lihnmdaAiSru0vGE2A2pfJlgRWl8cCgs5gicK1gRY+Y=; b=cHVjOGxNwMyri8aHN/e74Xui4qy6BSaTXz0PzS5RZS6hLcYm3yrqaWFX8hY6cYMVfz nB40AQzO6irf96VB9s2j8V5aDtI6ZvvRN0a60Kgk0SrvUVinp0/kWTFEpavZEsioztZq avobCgSBeDKgSVH+GCmJaZFgkrIVWzH893XKZ2P+4dgaCGsJ7Oo24TKwIHmMHKFP9GAX XloB2VOd91Rab8Et6A42rqdEkUdxS7J8c0F77siKbAkh3oTGibklu8wxmDmCUisbZvdU WuvtTliFRB1n0dhmcXM3Re5I9I6Zvi2lgSu9+Ry2ijCyoukxCOu6E5ye2XtkfH2dvust YL2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689648336; x=1690253136; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lihnmdaAiSru0vGE2A2pfJlgRWl8cCgs5gicK1gRY+Y=; b=dgDfjGNjwOm6YvaeTzaPzW21FB8Nbof0WatNyMqubVXRbgbx84xu3di+iaIyawwT7Z tYl6ZMFqFGoiVAxpLnnu6q7F3BErGbvRB5g+ant4oA1jayq9c0oBfJ018AZfbWSvntrv EyWnNX+wxxTupD2aVYgWmOf3AvpV3+PX5l2MGFv9JdZoOvjkN40mTUVWY1t8VheMYLkK QjD9RWSAVjcYPjXeMD5wS7LOgbDWuSXzgxINqC6mLf50JQz87tpuv+FO57/dGUobSgRn hg0Max12FaKZlAHQwcvklXKinTa2zE0JgLiYQ22x3KCN/HOZ8AorhEqW4D/lIasQh4XL fyqA== X-Gm-Message-State: ABy/qLbP9K6TMEeFJZs0wDkiLWLG038S9stsyNk+UvE9Li1Tr49JKeU/ jhBuDtCMi9HiR0SX5CgHUs4= X-Google-Smtp-Source: APBJJlEfjcwPc5QfY/zk9VDlC9GezJI/asPkF2kO8AGLo5YcUJbqg1FsgVXU/f1h9h3UjG0Z3/8ONQ== X-Received: by 2002:a0d:d705:0:b0:56f:f15a:2753 with SMTP id z5-20020a0dd705000000b0056ff15a2753mr15505887ywd.20.1689648335921; Mon, 17 Jul 2023 19:45:35 -0700 (PDT) Received: from smtpclient.apple ([2600:1700:22f6:4810:913b:ceaf:4f26:1fd7]) by smtp.gmail.com with ESMTPSA id o17-20020a0dcc11000000b005704c4d3579sm221386ywd.40.2023.07.17.19.45.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jul 2023 19:45:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: Curt Kolovson Mime-Version: 1.0 (1.0) Subject: Re: Bug in documentation: https://www.postgresql.org/docs/current/spi-examples.html Date: Mon, 17 Jul 2023 19:45:24 -0700 Message-Id: <9F566B71-42A3-4502-85CA-076BA8C5BDD5@gmail.com> References: <4124246.1689647806@sss.pgh.pa.us> Cc: "David G. Johnston" , pgsql-docs@lists.postgresql.org In-Reply-To: <4124246.1689647806@sss.pgh.pa.us> To: Tom Lane X-Mailer: iPhone Mail (20F75) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I=E2=80=99d vote for showing both (with RETURNING and without), since withou= t it the second argument to SPI_exec has no effect in this example, which ma= y not be obvious. That seems to be one of the subtle points illustrated by t= his example.=20 > On Jul 17, 2023, at 7:36 PM, Tom Lane wrote: >=20 > =EF=BB=BF"David G. Johnston" writes: >>> On Mon, Jul 17, 2023 at 6:22=E2=80=AFPM Tom Lane wro= te: >>> I think his point is that this example does not behave as the >>> documentation claims. Which it does not, according to my >>> tests here. I find this a bit disturbing --- did we intentionally >>> change the behavior of SPI_exec somewhere along the line? >=20 >> Appears to be a documentation fix oversight back in v9.0 >> https://github.com/postgres/postgres/commit/2ddc600f8f0252a0864e85d5cc1ee= b3b9687d7e9 >=20 > Ah, thanks for the pointer. I'd just been trying to bisect where > between 8.4 and 9.0 it changed, but failed because early-9.0 versions > don't build at all with current bison :-( >=20 > Anyway, given that the example needs updating, how should we do that > exactly? Is it worth demonstrating both the behavior with RETURNING > and that without? If not, which one to show? >=20 > regards, tom lane