Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYYXi-0005Fr-RZ for pgsql-general@arkaria.postgresql.org; Thu, 07 Oct 2021 18:54:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mYYXh-000280-Q7 for pgsql-general@arkaria.postgresql.org; Thu, 07 Oct 2021 18:54:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYYXg-00027r-6w for pgsql-general@lists.postgresql.org; Thu, 07 Oct 2021 18:54:57 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mYYXc-0005gy-M6 for pgsql-general@lists.postgresql.org; Thu, 07 Oct 2021 18:54:55 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 984173200F3D; Thu, 7 Oct 2021 14:54:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 07 Oct 2021 14:54:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=u nv+ELRWstpgofbWddB9Ju3oRp2XTxMHJexIE67Uh7A=; b=E9lMD9JGLtI/nx+05 GUs4s6cHdZpg/M6uE1bemhLUYmmgJ7U2dlJ5wuCtvgOFgne7JmaeZvxJaopDtpgu aMO4x7ognEuOW4lDNznNrPfsCdg8M6KVjJmKIHKad9Fb94/6A/1C/jzGY7Abimaf 2YL+zWpnBUiExpWn3q4ifxZEmB1tIxAvWhqImpyhZpg5cyvOSMMiczik5OxFDuqE fD4wJknOqGbb9k57H5r61KtBz6P4OSzdwWpAVfPSnPHLVu5dIXEv60TmZX1ca7XD Bu4bC5LEkHrQhAG5RUYlaWxmllTI2aZCgeX1OfaKaGgjTeYlYqTCRA2RRx4wvjKQ +m3/g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=unv+ELRWstpgofbWddB9Ju3oRp2XTxMHJexIE67Uh 7A=; b=NIVhjIBQW8Or7EiFs5iWHy7YUPl5+cAirqNlknnKWM+AFI+0CacF39IyH H5QrO/jitPSr5S1t3Ey0U3oQJYh6qn4cTHXvZ25WaKgloYYPc2STxY63RTQTexcw RupgftsNWwedOJoqQmgxOhSp3ysyk/x3YSkAzgChG3MdekSM+gPH76USDjSgIaJe GmnQRtCNHwNd+YQVDxAeZhJ8vALtM3sXiTJCrdKjBJMAEwAjq2Nw+QuNLn89Uqlp a9Squ2nSyB/ShYJLDZrYdxzk9y7rWSiOUEP3uneMu/fqEsFgXGE2u1oTKMeydcPP sBrpBPgpy2YTwaHPCX0JtmQ/LpOFQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelkedguddvlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefuvfhfhffkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpeetughr ihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtg homheqnecuggftrfgrthhtvghrnhepteejvdetffejuedvleeifeefheeutdfhgfdvhffh hfekvdduveegvdejudefgfevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpe hmrghilhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 7 Oct 2021 14:54:47 -0400 (EDT) Subject: Re: Regression in PL/PGSQL code using RETURN QUERY with Postgres 14 To: Gavin Roy , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Thu, 7 Oct 2021 11:54:46 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/7/21 11:38 AM, Gavin Roy wrote: > Hi All, > > My team was testing against Postgres 14 to ensure we could cleanly > upgrade and we ran across a regression in our PL/PGSQL code related to > the updates to RETURN QUERY. > > Our code which works in previous versions of Postgres uses UPDATE > RETURNING and INSERT RETURNING in combination with RETURN QUERY. It > appears that in the parallelism updates, RETURN QUERY now only accepts > SELECT queries. I'm pretty sure folks are going to want to see an example of the code and the errors thrown in version 14. > > Was this an intentional change in behavior? We can easily refactor our > PL/PGSQL functions to deal with the change, but if it was intentional, > perhaps it should be documented. > > Regards, > > Gavin -- Adrian Klaver adrian.klaver@aklaver.com