summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2024-04-06 20:45:05 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2024-04-06 20:45:11 -0400
commit90f5178211cd63ac16fb8c8b2fe43d53d2854da1 (patch)
tree8cd29b9638ca5df011b85f6eb3e157834f3b81b5 /src/test
parent4643a2b265e967cc5f13ffa0c7c6912dbb3466d0 (diff)
Re-implement psql's FETCH_COUNT feature atop libpq's chunked mode.
Formerly this was done with a cursor, which is problematic since not all result-set-returning query types can be put into a cursor. The new implementation is better integrated into other psql features, too. Daniel Vérité, reviewed by Laurenz Albe and myself (and whacked around a bit by me, so any remaining bugs are my fault) Discussion: https://postgr.es/m/CAKZiRmxsVTkO928CM+-ADvsMyePmU3L9DQCa9NwqjvLPcEe5QA@mail.gmail.com
Diffstat (limited to 'src/test')
-rw-r--r--src/test/regress/expected/psql.out4
-rw-r--r--src/test/regress/sql/psql.sql4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/test/regress/expected/psql.out b/src/test/regress/expected/psql.out
index 69060fe3c00..0b8dd7abf2d 100644
--- a/src/test/regress/expected/psql.out
+++ b/src/test/regress/expected/psql.out
@@ -4755,7 +4755,7 @@ number of rows: 0
last error message: syntax error at end of input
\echo 'last error code:' :LAST_ERROR_SQLSTATE
last error code: 42601
--- check row count for a cursor-fetched query
+-- check row count for a query with chunked results
\set FETCH_COUNT 10
select unique2 from tenk1 order by unique2 limit 19;
unique2
@@ -4787,7 +4787,7 @@ error: false
error code: 00000
\echo 'number of rows:' :ROW_COUNT
number of rows: 19
--- cursor-fetched query with an error after the first group
+-- chunked results with an error after the first chunk
select 1/(15-unique2) from tenk1 order by unique2 limit 19;
?column?
----------
diff --git a/src/test/regress/sql/psql.sql b/src/test/regress/sql/psql.sql
index 129f8533537..33076cad79e 100644
--- a/src/test/regress/sql/psql.sql
+++ b/src/test/regress/sql/psql.sql
@@ -1161,14 +1161,14 @@ SELECT 4 AS \gdesc
\echo 'last error message:' :LAST_ERROR_MESSAGE
\echo 'last error code:' :LAST_ERROR_SQLSTATE
--- check row count for a cursor-fetched query
+-- check row count for a query with chunked results
\set FETCH_COUNT 10
select unique2 from tenk1 order by unique2 limit 19;
\echo 'error:' :ERROR
\echo 'error code:' :SQLSTATE
\echo 'number of rows:' :ROW_COUNT
--- cursor-fetched query with an error after the first group
+-- chunked results with an error after the first chunk
select 1/(15-unique2) from tenk1 order by unique2 limit 19;
\echo 'error:' :ERROR
\echo 'error code:' :SQLSTATE