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
обсуждение исходный текст
Ответ на Re: Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12  ("Andrus" <kobruleht2@hot.ee>)
Список pgsql-general
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"
Дата:
Сообщение: Re: Fixing set-returning functions are not allowed in UPDATE after upgrade to Postgres 12
Следующее
От: Tim Cross
Дата:
Сообщение: Re: Improve COPY performance into table with indexes.