Re: Update multiple rows in a table with different values

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Update multiple rows in a table with different values
Дата
Msg-id 19750.1467385184@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Update multiple rows in a table with different values  (shankha <shankhabanerjee@gmail.com>)
Ответы Re: Update multiple rows in a table with different values  (shankha <shankhabanerjee@gmail.com>)
Список pgsql-general
shankha <shankhabanerjee@gmail.com> writes:
> PREPARE updatearrayplan(BigInt[], BigInt[]) AS
>         for i in size($1)
>         DO
>             update s.t1
>             SET c3 = $2[$i]
>             WHERE c2 = $1[$i]
>         END FOR

> In this prepared statement I am just trying to explain the algorithm.
> I do not know the exact syntax.

You would need to write a plpgsql function in order to have a loop like
that; there's no loops in bare SQL.

            regards, tom lane


В списке pgsql-general по дате отправления:

Предыдущее
От: shankha
Дата:
Сообщение: Re: Update multiple rows in a table with different values
Следующее
От: Chris Lewis
Дата:
Сообщение: Re: Log archiving failing. Seems to be wrong timeline