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 1jK1AA-0004Xt-Sl for pgsql-general@arkaria.postgresql.org; Thu, 02 Apr 2020 14:49:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jK1A8-0007CF-M6 for pgsql-general@arkaria.postgresql.org; Thu, 02 Apr 2020 14:49:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jK1A8-0007C8-EG for pgsql-general@lists.postgresql.org; Thu, 02 Apr 2020 14:49:44 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jK1A5-0000eH-02 for pgsql-general@postgresql.org; Thu, 02 Apr 2020 14:49:43 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id B60801CC5 for ; Thu, 2 Apr 2020 17:49:36 +0300 (EEST) X-Virus-Scanned: Debian amavisd-new at vm-hot-relay10.estpak.ee Received: from portal-smtp-out.hot.ee ([127.0.0.1]) by localhost (vm-hot-relay10.estpak.ee [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iOp+D08sbiAV for ; Thu, 2 Apr 2020 17:49:33 +0300 (EEST) Received: from mail.hot.ee (hot-relayhost1.estpak.ee [213.180.2.79]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id B27461D6E for ; Thu, 2 Apr 2020 17:49:11 +0300 (EEST) Received: from dell2 (66-63-196-88.sta.estpak.ee [88.196.63.66]) (Authenticated sender: kobruleht2) by HOT-Relayhost1.estpak.ee (Postfix) with ESMTPSA id 48tQtv4Thrz2cs for ; Thu, 2 Apr 2020 17:49:10 +0300 (EEST) Message-ID: From: "Andrus" To: "pgsql-general" Subject: Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12 Date: Thu, 2 Apr 2020 17:48:59 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="windows-1257"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Mailer: Microsoft Windows Live Mail 16.4.3528.331 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3528.331 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi! After upgrading to Postgres 12 statement update temprid set ContactFirstName =unnest(xpath( '/E-Document/Document/DocumentParties/BuyerParty/ContactData/ContactFirstName/text()',x))::text, yhik =unnest(xpath( '/E-Document/Document/DocumentItem/ItemEntry/BaseUnit/text()',x))::text from t throws error set-returning functions are not allowed in UPDATE How to fix this ? Maybe there is simply change which makes this statement work ? Result should by any value of xpath expression in case if xpath returns multiple values In Postgres 9.1 it worked. Andrus.