pgsql.cc 提供对 postgresql.org 官网内容的中文翻译,由 Pigsty 团队维护。
pg_cursors #该pg_cursors视图列出当前可用的游标。游标可以通过几种方式定义:
通过SQL中的DECLARE语句
通过前端/后端协议中的Bind消息,如第 46.2.3 节中所述
通过服务器编程接口(SPI),如第 43.1 节中所述
该pg_cursors视图会显示通过上述任意方式创建的游标。游标仅在定义它的事务持续期间存在,除非将其声明为WITH HOLD。因此,不可保持的游标只会在此视图中保留到创建它的事务结束为止。
游标在内部用于实现PostgreSQL的某些组件,如过程语言。因此,pg_cursors视图可能包含用户未明确创建的游标。
表 45.56. pg_cursors 列
| Name | Type | Description |
|---|---|---|
name |
text |
The name of the cursor |
statement |
text |
The verbatim query string submitted to declare this cursor |
is_holdable |
boolean |
true if the cursor is holdable (that is, it can be accessed after the transaction that declared the cursor has committed); false otherwise |
is_binary |
boolean |
true if the cursor was declared BINARY; false otherwise |
is_scrollable |
boolean |
true if the cursor is scrollable (that is, it allows rows to be retrieved in a nonsequential manner); false otherwise |
creation_time |
timestamptz |
The time at which the cursor was declared |
pg_cursors视图是只读的。
译文有误、术语不当或页面显示问题,请到译文仓库 pgsty/pgdoc 报告译文问题。 英文原文本身的问题,请在当前版本的对应页面向上游反馈;上游不再修订已结束维护的版本。