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 1qLZQo-0009S2-2J for pgsql-docs@arkaria.postgresql.org; Tue, 18 Jul 2023 01:23:13 +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 1qLZPl-001lY5-7s for pgsql-docs@arkaria.postgresql.org; Tue, 18 Jul 2023 01:22:09 +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 1qLZPl-001lXx-0o for pgsql-docs@lists.postgresql.org; Tue, 18 Jul 2023 01:22:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qLZPh-00027d-9h for pgsql-docs@lists.postgresql.org; Tue, 18 Jul 2023 01:22:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 36I1M2Rw4114625; Mon, 17 Jul 2023 21:22:02 -0400 From: Tom Lane To: "David G. Johnston" cc: Curt Kolovson , pgsql-docs@lists.postgresql.org Subject: Re: Bug in documentation: https://www.postgresql.org/docs/current/spi-examples.html In-reply-to: References: Comments: In-reply-to "David G. Johnston" message dated "Mon, 17 Jul 2023 17:26:26 -0700" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <4114623.1689643322.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 17 Jul 2023 21:22:02 -0400 Message-ID: <4114624.1689643322@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk "David G. Johnston" writes: > On Mon, Jul 17, 2023 at 4:53 PM Curt Kolovson wrote: >> The actual results (shown below) are different than shown on this doc >> page. > 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. 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? regards, tom lane