Re: problem with function to report how many records were changed

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: problem with function to report how many records were changed
Дата
Msg-id 12029.1066325905@sss.pgh.pa.us
обсуждение исходный текст
Ответ на problem with function to report how many records were changed  (<enio@pmpf.rs.gov.br>)
Список pgsql-general
<enio@pmpf.rs.gov.br> writes:
>   execute ''update '' || quote_ident(table) || '' set '' ||
> quote_ident(field) '' = '' || quote_literal(val1) ||
>               '' where '' || quote_ident(field) || '' = '' ||
> quote_literal(val2);
>    if found then

I don't believe EXECUTE sets FOUND.  You'll need to do something else,
perhaps use FOR IN EXECUTE.

> I am using postgresql version 7.2.3

You'll probably also need to use a newer Postgres release; IIRC 7.2
didn't set FOUND properly in for-loops.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: ShmemAlloc errors
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: UPDATE table to a joined query...