Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12

From: "Andrus" <kobruleht2(at)hot(dot)ee>
To: "pgsql-general" <pgsql-general(at)postgresql(dot)org>
Subject: Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12
Date: 2020-04-02 14:48:59
Message-ID: B45C75638FC04DD1A56F10240E037DC4@dell2
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2020-04-02 14:57:48 Re: Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12
Previous Message Laurenz Albe 2020-04-02 08:53:28 Re: using a common key value on both sides of a union ?