Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Apr 2, 2020 at 11:38 PM Andrus <kobruleht2@xxxxxx> wrote:
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


Parens around the function call _expression_ are required per the syntax documentation for array subscript access:


update temprid set
    ContactFirstName =(xpath(
         '/E-Document/Document/DocumentParties/BuyerParty/ContactData/ContactFirstName/text()',x))[1]::text  

David J.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux