How to update rows from a cursor in PostgreSQL

From: Ruben <ruben12(at)superguai(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: How to update rows from a cursor in PostgreSQL
Date: 2003-02-21 20:09:11
Message-ID: 3E568767.2040509@superguai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was trying something like:

select * from t1, t2, t3, t4
where ...
for update of t1

while(fetch...)
{
update
where current
}

Since "FOR UPDATE" cursors are not supported in PostgreSQL, can I update
the current row of table t1?

Thanks a lot!

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Eric B.Ridge 2003-02-21 20:09:45 Views + Rules + Triggers + 7.3.2 = Upgrade Problems (was: Re: REWRITE_INVOKE_MAX and "query may contain cycles" )
Previous Message Neil Conway 2003-02-21 20:08:07 Re: reindex vs. drop index , create index