Skip to content

Commit 3727b8d

Browse files
committed
pg_stat_statements: Add test coverage for pg_stat_statements_1_8()
This requires reading pg_stat_statements at least once while the 1.8 version of the extension is installed. Reviewed-by: Michael Paquier <michael@paquier.xyz> Discussion: https://www.postgresql.org/message-id/flat/40d1e4f2-835f-448f-a541-8ff5db75bf3d@eisentraut.org
1 parent 7d7ef07 commit 3727b8d

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

contrib/pg_stat_statements/expected/oldextversions.out

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ SELECT count(*) > 0 AS has_data FROM pg_stat_statements;
8888

8989
-- New functions and views for pg_stat_statements in 1.8
9090
AlTER EXTENSION pg_stat_statements UPDATE TO '1.8';
91+
SELECT pg_get_functiondef('pg_stat_statements_reset'::regproc);
92+
pg_get_functiondef
93+
--------------------------------------------------------------------------------------------------------------------------------
94+
CREATE OR REPLACE FUNCTION public.pg_stat_statements_reset(userid oid DEFAULT 0, dbid oid DEFAULT 0, queryid bigint DEFAULT 0)+
95+
RETURNS void +
96+
LANGUAGE c +
97+
PARALLEL SAFE STRICT +
98+
AS '$libdir/pg_stat_statements', $function$pg_stat_statements_reset_1_7$function$ +
99+
100+
(1 row)
101+
91102
\d pg_stat_statements
92103
View "public.pg_stat_statements"
93104
Column | Type | Collation | Nullable | Default
@@ -125,15 +136,10 @@ AlTER EXTENSION pg_stat_statements UPDATE TO '1.8';
125136
wal_fpi | bigint | | |
126137
wal_bytes | numeric | | |
127138

128-
SELECT pg_get_functiondef('pg_stat_statements_reset'::regproc);
129-
pg_get_functiondef
130-
--------------------------------------------------------------------------------------------------------------------------------
131-
CREATE OR REPLACE FUNCTION public.pg_stat_statements_reset(userid oid DEFAULT 0, dbid oid DEFAULT 0, queryid bigint DEFAULT 0)+
132-
RETURNS void +
133-
LANGUAGE c +
134-
PARALLEL SAFE STRICT +
135-
AS '$libdir/pg_stat_statements', $function$pg_stat_statements_reset_1_7$function$ +
136-
139+
SELECT count(*) > 0 AS has_data FROM pg_stat_statements;
140+
has_data
141+
----------
142+
t
137143
(1 row)
138144

139145
-- New function pg_stat_statement_info, and new function

contrib/pg_stat_statements/sql/oldextversions.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ SELECT count(*) > 0 AS has_data FROM pg_stat_statements;
3333

3434
-- New functions and views for pg_stat_statements in 1.8
3535
AlTER EXTENSION pg_stat_statements UPDATE TO '1.8';
36-
\d pg_stat_statements
3736
SELECT pg_get_functiondef('pg_stat_statements_reset'::regproc);
37+
\d pg_stat_statements
38+
SELECT count(*) > 0 AS has_data FROM pg_stat_statements;
3839

3940
-- New function pg_stat_statement_info, and new function
4041
-- and view for pg_stat_statements introduced in 1.9

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy