Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Databases - Practical PostgreSQL
Previous Page Home Next Page

CLOSE

Name

CLOSE -- Closes a previously defined cursor object.

Synopsis

CLOSE 
cursor

Parameters

cursor

The name of a currently open cursor that you wish to close.

Results

CLOSE

The message returned when the cursor is successfully closed.

NOTICE: PerformPortalClose: portal " cursor " not found

The notice returned if the specified cursor is either not declared, or not open.

Description

The CLOSE command closes an open cursor and frees the resources it was using. Cursors should always be closed after they are no longer needed. Once a cursor is closed, further operations are not allowed on it.

Note: Executing a COMMIT or ROLLBACK terminates the current transaction, closing all open cursors.

Examples

The following example opens a transaction, declares the cur_publishers cursor, and closes it:

booktown=# 
BEGIN;

BEGIN
booktown=# 
DECLARE cur_publishers CURSOR FOR SELECT * FROM publishers;

SELECT
booktown=# 
CLOSE cur_publishers;

CLOSE
Databases - Practical PostgreSQL
Previous Page Home Next Page

 
 
  Published under the terms of the Open Publication License Design by Interspire