Current OF does not look to work for UPDATE and DELETE operations.
For distributed tables
template1=# create table aa (a int, b int);
CREATE TABLE
template1=# insert into aa values (1,1),(1,2),(1,4),(4,8),(2,5);
INSERT 0 4
template1=# begin;
BEGIN
template1=# declare foo cursor for select * from aa_rep for update;
DECLARE CURSOR
template1=# fetch forward from foo;
a | b
---+---
1 | 1
(1 row)
template1=# fetch forward from foo;
a | b
---+---
1 | 2
(1 row)
template1=# delete from aa_rep where current of foo;
DELETE 0
template1=# fetch forward from foo;
a | b
---+---
1 | 4
(1 row)
template1=# delete from aa_rep where current of foo;
DELETE 0
template1=# commit;
COMMIT
template1=# select * from aa;
a | b
---+---
1 | 1
1 | 2
1 | 4
2 | 5
(4 rows)
It works OK for distributed tables.
This case works for the following initialization and not the distributed table case (damn the small windows of this bug tracker :~!)
template1=# create table aa_rep (a int, b int) distribute by replication;
CREATE TABLE
template1=# insert into aa_rep values (1,1),(1,2),(1,4),(4,8);
INSERT 0 4
For 1.0, this should be blocked.
WHERE CURRENT OF is blocked for now. Moving this case to 1.1 Dev Q
This should be out of the scope for the next major release.