1CLOSE(7)                         SQL Commands                         CLOSE(7)
2
3
4

NAME

6       CLOSE - close a cursor
7
8

SYNOPSIS

10       CLOSE { name | ALL }
11
12

DESCRIPTION

14       CLOSE  frees  the  resources associated with an open cursor.  After the
15       cursor is closed, no subsequent operations are allowed on it. A  cursor
16       should be closed when it is no longer needed.
17
18       Every  non-holdable open cursor is implicitly closed when a transaction
19       is terminated by COMMIT or ROLLBACK. A holdable  cursor  is  implicitly
20       closed  if  the transaction that created it aborts via ROLLBACK. If the
21       creating transaction successfully commits, the holdable cursor  remains
22       open until an explicit CLOSE is executed, or the client disconnects.
23

PARAMETERS

25       name   The name of an open cursor to close.
26
27       ALL    Close all open cursors.
28

NOTES

30       PostgreSQL does not have an explicit OPEN cursor statement; a cursor is
31       considered open when it  is  declared.  Use  the  DECLARE  [declare(7)]
32       statement to declare a cursor.
33
34       You  can  see  all  available cursors by querying the pg_cursors system
35       view.
36
37       If a cursor is closed after a savepoint which is later rolled back, the
38       CLOSE is not rolled back; that is, the cursor remains closed.
39

EXAMPLES

41       Close the cursor liahona:
42
43       CLOSE liahona;
44
45

COMPATIBILITY

47       CLOSE  is  fully conforming with the SQL standard. CLOSE ALL is a Post‐
48       greSQL extension.
49

SEE ALSO

51       DECLARE [declare(7)], FETCH [fetch(7)], MOVE [move(7)]
52
53
54
55SQL - Language Statements         2011-09-22                          CLOSE(7)
Impressum