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

Поиск
Список
Период
Сортировка
Искать
От
David G. Johnston
Тема
Re: Fixing set-returning functions are not allowed in UPDATE afterupgrade to Postgres 12
Дата
Msg-id
CAKFQuwbqwpPkzDWuL_ehhuYHJtn4ZqAxmGCB2oOEiL_6Aeponw@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12 "Andrus" <kobruleht2@hot.ee>
Re: Fixing set-returning functions are not allowed in UPDATE afterupgrade to Postgres 12 Laurenz Albe <laurenz.albe@cybertec.at>
Re: Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12 "Andrus" <kobruleht2@hot.ee>
Re: Fixing set-returning functions are not allowed in UPDATE afterupgrade to Postgres 12 "David G. Johnston" <david.g.johnston@gmail.com>
On Thu, Apr 2, 2020 at 11:38 PM Andrus <kobruleht2@hot.ee> 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.

В списке pgsql-general по дате отправления
От: Andrus
Дата:
От: Tim Cross
Дата:
FAQ