NAME
CLOSE - 关闭一个游标
SYNOPSIS
CLOSE name
DESCRIPTION 描述
CLOSE 释放和一个游标关联的资源。 一个游标关闭后,不允许对其再做任何操作。一个不再使用的游标应该关闭掉。
在一个事务用 COMMIT 或者 ROLLBACK 终止之后, 每个不可保持的已打开游标都隐含关闭。如果创建事务通过 ROLLBACK 退出, 那么一个可以保持的游标隐含关闭。如果创建事务成功提交,那么可保持的游标保持打开, 直到执行一个明确的 CLOSE,或者客户端断开。
PARAMETERS 参数
- name
一个待关闭的游标的名字。
NOTES 注意
PostgreSQL 没有明确的 OPEN (打开)游标的语句; 我们认为一个游标在声明时就打开了。使用 DECLARE 语句声明一个游标。
EXAMPLES 例子
关闭游标 liahona:
CLOSE liahona;
#p#
NAME
CLOSE - close a cursor
SYNOPSIS
CLOSE name
DESCRIPTION
CLOSE frees the resources associated with an open cursor. After the cursor is closed, no subsequent operations are allowed on it. A cursor should be closed when it is no longer needed.
Every non-holdable open cursor is implicitly closed when a transaction is terminated by COMMIT or ROLLBACK. A holdable cursor is implicitly closed if the transaction that created it aborts via ROLLBACK. If the creating transaction successfully commits, the holdable cursor remains open until an explicit CLOSE is executed, or the client disconnects.
PARAMETERS
- name
- The name of an open cursor to close.
NOTES
PostgreSQL does not have an explicit OPEN cursor statement; a cursor is considered open when it is declared. Use the DECLARE statement to declare a cursor.
EXAMPLES
Close the cursor liahona:
CLOSE liahona;