statement
CLOSE
Releases a PostgreSQL cursor and its resources. The enclosing transaction remains active. Example target: PostgreSQL 17. Use only the isolated starter dataset; setup and expected results are in the batch evidence.
Formal Syntax & Structure
sql syntaxsql
CLOSE cursor_nameWorking Example
Example Snippetsql
BEGIN; DECLARE lab_cursor CURSOR FOR SELECT id FROM customers ORDER BY id;CLOSE lab_cursor;