pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrus <kobruleht2@hot.ee>
To: Laurenz Albe <laurenz.albe@cybertec.at>
To: pgsql-general <pgsql-general@postgresql.org>
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
Message-ID: <EE75EFEEE1444A3883206B762AB13B10@dell2> (raw)
In-Reply-To: <f8e93dacd7bfa5c5285d13132694c3e642ae1ef7.camel@cybertec.at>
References: <B45C75638FC04DD1A56F10240E037DC4@dell2>
	<f8e93dacd7bfa5c5285d13132694c3e642ae1ef7.camel@cybertec.at>

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-updat...

Andrus.





view thread (4+ messages)  latest in thread

Message-ID: <EE75EFEEE1444A3883206B762AB13B10@dell2>
Permalink:  ../EE75EFEEE1444A3883206B762AB13B10@dell2/
Also on:    postgresql.org/message-id/EE75EFEEE1444A3883206B762AB13B10@dell2

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: kobruleht2@hot.ee, laurenz.albe@cybertec.at
  Subject: Re: Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12
  In-Reply-To: <EE75EFEEE1444A3883206B762AB13B10@dell2>
  References: <B45C75638FC04DD1A56F10240E037DC4@dell2> <f8e93dacd7bfa5c5285d13132694c3e642ae1ef7.camel@cybertec.at> <EE75EFEEE1444A3883206B762AB13B10@dell2>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox