Appearance
CLOSE
Close a cursor.
CLOSE { name | ALL }
You can close all open cursors or a specific cursor that you name. After you have closed a cursor, no subsequent operations are allowed on it. Close a cursor when it is no longer needed.
See also DECLARE, FETCH, and MOVE cursor.
Examples
For example, close a named cursor within a script:
begin;
declare match cursor for select * from match order by matchday;
fetch next from match;
...
close match;
end;
Close all currently open cursors:
premdb=# close all;
CLOSE CURSOR ALL