Re: how to use a cursor for update?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: nicola zandonà <nick(dot)zando(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to use a cursor for update?
Date: 2009-11-20 15:05:55
Message-ID: 21771.1258729555@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?ISO-8859-1?Q?nicola_zandon=E0?= <nick(dot)zando(at)gmail(dot)com> writes:
> When i try to execute this code i get a :

> ERROR: cursor "cur" is not a simply updatable scan of table "zone"
> CONTEXT: SQL statement "UPDATE zone SET end_period = $1 WHERE
> CURRENT OF $2 "
> PL/pgSQL function "test_select" line 16 at SQL statement

The example works for me, using a simple definition of the "zone"
table. Maybe your "zone" is not a table but a complicated view?

Or it could be a bug that's been fixed. What PG version are you using?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Matthew Wakeling 2009-11-20 15:08:00 Re: [PERFORM] Strange performance degradation
Previous Message Ray Stell 2009-11-20 15:03:04 Re: index storage planning