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 1qLZuX-000Aa8-3c for pgsql-docs@arkaria.postgresql.org; Tue, 18 Jul 2023 01:53:56 +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 1qLZtW-0028IO-Df for pgsql-docs@arkaria.postgresql.org; Tue, 18 Jul 2023 01:52:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLZtW-0028Ex-58 for pgsql-docs@lists.postgresql.org; Tue, 18 Jul 2023 01:52:54 +0000 Received: from mail-yb1-xb2a.google.com ([2607:f8b0:4864:20::b2a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qLZtO-0002gh-Q4 for pgsql-docs@lists.postgresql.org; Tue, 18 Jul 2023 01:52:53 +0000 Received: by mail-yb1-xb2a.google.com with SMTP id 3f1490d57ef6-bdd069e96b5so5340857276.2 for ; Mon, 17 Jul 2023 18:52:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689645166; x=1690249966; 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=4Wp8I/QqnVeH26tFvHHgOBEHt0MXaid+qxC7ODrdcBY=; b=VPvE/O+7rD/NV0yuw7l7/tBdkdX74JNF3Zv4BVq/RAFTishJ8XTdR5mtLTdx3n5WFZ hGplb6MnIG/yipShG+wBrVIkvTDw8mF4W7HU6gDys3qcXoKa8S6x2Bx22Vho6ZGtp8z1 vV8BiS40IcA9XdkP4inly1KzTmMo0VV0gyYMtyhtNa5lPdF3S6r1h3OwaG0C+67uGUzs AP9bu955sbpaw15V2b+O5mhK9ZSBuTJdhKtW5rVDNgzW2wM1YMEdGsOECcH+rwYWyrAk rLhLgBKBpdMyHL25zR1clXoJ/miDcdqLlCBb6GdkJ9gYQeonZLYJ56DQ878kPbnd2p1T aBtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689645166; x=1690249966; 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=4Wp8I/QqnVeH26tFvHHgOBEHt0MXaid+qxC7ODrdcBY=; b=j/1kPqgRQbbZnKTLhi+6Wmu+hcjekPRdtQVUqjI+lTybdBRPNZmDAjQkBkJc9e71eO QjezFPucBaaUptvssoaHYQcFgUgDr/rpKyRADk2WBZAed6Ak4YAOy+oGDcODZ2XE4KmP FJ1ky/mviENo2bLafggIQ4PdXzbhSmG+4cV1sBq8nwu6A8igbwZo1Q47/S6Zy5iEAmHL pWYNU5zNHdAPHoVVUFymZsGtWcvhKJpz3GSx3um0bZ36FQppJWHdP1M+GZUU+P9rZjMJ ndXINjQhbZ6gE6ZJGSgOrkTFaTdgGwAnP7d51LJzLLl9NM2JWR79dL98MFSa2er1rtpz nwdA== X-Gm-Message-State: ABy/qLZxxvQ/6K+VrPCWvfBn1suOU0F98oQJDuQ2VOlkJKFgmdadMb2W NhvS3rtrN5iFsfqMoOzgnfO+WDdGrJc= X-Google-Smtp-Source: APBJJlE9l+Kzkh//hziZtk6EfRDrRNHW8aYhxERo6FJwkxYCsGdO17FCoxJuZkmb7F97kZ41wFFCyA== X-Received: by 2002:a81:61d5:0:b0:577:1e1e:c950 with SMTP id v204-20020a8161d5000000b005771e1ec950mr14307917ywb.9.1689645165805; Mon, 17 Jul 2023 18:52:45 -0700 (PDT) Received: from smtpclient.apple ([2600:1700:22f6:4810:913b:ceaf:4f26:1fd7]) by smtp.gmail.com with ESMTPSA id u84-20020a816057000000b00568b941e5e3sm198239ywb.72.2023.07.17.18.52.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Jul 2023 18:52:45 -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 18:52:34 -0700 Message-Id: <672A5662-FB6C-454B-AD82-BDC30474E47C@gmail.com> References: <4114624.1689643322@sss.pgh.pa.us> Cc: "David G. Johnston" , pgsql-docs@lists.postgresql.org In-Reply-To: <4114624.1689643322@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 Tom is correct. It appears that nobody tested this example, which by the way= seems unnecessarily complicated.=20 Sent from my iPhone > On Jul 17, 2023, at 6:22 PM, Tom Lane wrote: >=20 > =EF=BB=BF"David G. Johnston" writes: >>> On Mon, Jul 17, 2023 at 4:53=E2=80=AFPM Curt Kolovson wrote: >>> The actual results (shown below) are different than shown on this doc >>> page. >=20 >> SPI_exec sees "INSERT 0 2" as the command tag from the SQL command you >> passed and so 2 is the output of the execq function call. >> No INFO messages appear because you did not include a returning clause. >> The 1 you passed to the call is immaterial if the query you supply doesn'= t >> produce a result set. >=20 > 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 > regards, tom lane