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 1jKFxo-0001n4-Rt for pgsql-general@arkaria.postgresql.org; Fri, 03 Apr 2020 06:38:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jKFxn-0008Iq-Et for pgsql-general@arkaria.postgresql.org; Fri, 03 Apr 2020 06:37:59 +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 1jKFxn-0008Ij-7H for pgsql-general@lists.postgresql.org; Fri, 03 Apr 2020 06:37:59 +0000 Received: from portal-smtp-out.hot.ee ([194.126.101.125]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jKFxe-0003AL-Pv for pgsql-general@postgresql.org; Fri, 03 Apr 2020 06:37:57 +0000 Received: from localhost (localhost [127.0.0.1]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 919A81D66; Fri, 3 Apr 2020 09:37:49 +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 MEoil6pGMyzi; Fri, 3 Apr 2020 09:37:47 +0300 (EEST) Received: from mail.hot.ee (hot-relayhost2.estpak.ee [213.180.2.80]) by vm-hot-relay10.estpak.ee (Postfix) with ESMTP id 184841D61; Fri, 3 Apr 2020 09:37:47 +0300 (EEST) Received: from dell2 (66-63-196-88.sta.estpak.ee [88.196.63.66]) (Authenticated sender: kobruleht2) by HOT-Relayhost2.estpak.ee (Postfix) with ESMTPSA id 48tqxP6cZmz2m2; Fri, 3 Apr 2020 09:37:44 +0300 (EEST) Message-ID: From: "Andrus" To: "Laurenz Albe" , "pgsql-general" References: In-Reply-To: Subject: Re: Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12 Date: Fri, 3 Apr 2020 09:37:39 +0300 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="utf-8"; 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! >Simply replace > SET col = unnest(array_value) >with > > SET col = array_value[1] I tried update temprid set ContactFirstName =xpath( '/E-Document/Document/DocumentParties/BuyerParty/ContactData/ContactFirstName/text()',x)[1]::text But got error ERROR: syntax error at or near "[" LINE 3: .../BuyerParty/ContactData/ContactFirstName/text()',x)[1]::text How to fix ? Posted also in https://stackoverflow.com/questions/60993975/fixing-set-returning-functions-are-not-allowed-in-update Andrus.