aboutsummaryrefslogtreecommitdiff
path: root/src/test/regress/sql/portals.sql
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/regress/sql/portals.sql')
-rw-r--r--src/test/regress/sql/portals.sql25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/regress/sql/portals.sql b/src/test/regress/sql/portals.sql
index da4e3b0e3ae..c0307874e80 100644
--- a/src/test/regress/sql/portals.sql
+++ b/src/test/regress/sql/portals.sql
@@ -168,8 +168,14 @@ CLOSE foo12;
-- leave some cursors open, to test that auto-close works.
+-- record this in the system view as well (don't query the time field there
+-- however)
+SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors;
+
END;
+SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors;
+
--
-- NO SCROLL disallows backward fetching
--
@@ -188,6 +194,9 @@ END;
-- Cursors outside transaction blocks
--
+
+SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors;
+
BEGIN;
DECLARE foo25 SCROLL CURSOR WITH HOLD FOR SELECT * FROM tenk2;
@@ -204,6 +213,8 @@ FETCH BACKWARD FROM foo25;
FETCH ABSOLUTE -1 FROM foo25;
+SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors;
+
CLOSE foo25;
--
@@ -278,3 +289,17 @@ fetch all from c2;
drop function count_tt1_v();
drop function count_tt1_s();
+
+
+-- Create a cursor with the BINARY option and check the pg_cursors view
+BEGIN;
+SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors;
+DECLARE bc BINARY CURSOR FOR SELECT * FROM tenk1;
+SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors;
+ROLLBACK;
+
+-- We should not see the portal that is created internally to
+-- implement EXECUTE in pg_cursors
+PREPARE cprep AS
+ SELECT name, statement, is_holdable, is_binary, is_scrollable FROM pg_cursors;
+EXECUTE cprep;