Re: Fixing set-returning functions are not allowed in UPDATE afterupgrade to Postgres 12 - Mailing list pgsql-general

From Laurenz Albe
Subject Re: Fixing set-returning functions are not allowed in UPDATE afterupgrade to Postgres 12
Date
Msg-id f8e93dacd7bfa5c5285d13132694c3e642ae1ef7.camel@cybertec.at
Whole thread Raw
In response to Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12  ("Andrus" <kobruleht2@hot.ee>)
Responses Re: Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12
List pgsql-general
On Thu, 2020-04-02 at 17:48 +0300, Andrus wrote:
> 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 ?

Simply replace

   SET col = unnest(array_value)

with

   SET col = array_value[1]

Yours,
Laurenz Albe
-- 
Cybertec | https://www.cybertec-postgresql.com




pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12
Next
From: "Abraham, Danny"
Date:
Subject: too many clients already