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