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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: enio(at)pmpf(dot)rs(dot)gov(dot)br
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: problem with function to report how many records were changed
Date: 2003-10-16 17:38:25
Message-ID: 12029.1066325905@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

<enio(at)pmpf(dot)rs(dot)gov(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephen 2003-10-16 17:40:02 Re: VACUUM degrades performance significantly. Database becomes unusable!
Previous Message Tom Lane 2003-10-16 17:33:41 Re: ShmemAlloc errors