Re: problem with function to report how many records were changed - Mailing list pgsql-general

From Tom Lane
Subject Re: problem with function to report how many records were changed
Date
Msg-id 12029.1066325905@sss.pgh.pa.us
Whole thread Raw
In response to problem with function to report how many records were changed  (<enio@pmpf.rs.gov.br>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: ShmemAlloc errors
Next
From: Bruno Wolff III
Date:
Subject: Re: UPDATE table to a joined query...