diff -U3 /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/select.out /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/select.out --- /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/select.out 2024-09-10 10:45:56.251065000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/select.out 2024-09-10 10:49:21.718022000 +0000 @@ -2,14 +2,14 @@ -- SELECT statements -- CREATE EXTENSION pg_stat_statements; +ERROR: extension "pg_stat_statements" has no installation script nor update path for version "1.12" SET pg_stat_statements.track_utility = FALSE; SET pg_stat_statements.track_planning = TRUE; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- -- simple and compound statements -- @@ -125,44 +125,24 @@ DEALLOCATE pgss_test; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+------------------------------------------------------------------------------ - 1 | 1 | PREPARE pgss_test (int) AS SELECT $1, $2 LIMIT $3 - 4 | 4 | SELECT $1 + - | | -- multiline + - | | AS "text" - 2 | 2 | SELECT $1 + $2 - 3 | 3 | SELECT $1 + $2 + $3 AS "add" - 1 | 1 | SELECT $1 AS "float" - 2 | 2 | SELECT $1 AS "int" - 1 | 2 | SELECT $1 AS i UNION SELECT $2 ORDER BY i - 1 | 1 | SELECT $1 || $2 - 0 | 0 | SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C" - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t - 1 | 2 | WITH t(f) AS ( + - | | VALUES ($1), ($2) + - | | ) + - | | SELECT f FROM t ORDER BY f - 1 | 1 | select $1::jsonb ? $2 -(12 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- -- queries with locking clauses -- CREATE TABLE pgss_a (id integer PRIMARY KEY); CREATE TABLE pgss_b (id integer PRIMARY KEY, a_id integer REFERENCES pgss_a); SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- control query SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id; id | id | a_id @@ -223,38 +203,22 @@ (0 rows) SELECT calls, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | query --------+------------------------------------------------------------------------------------------ - 1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id - 1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR KEY SHARE - 1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR NO KEY UPDATE - 1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR SHARE - 2 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE - 1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE NOWAIT - 1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE OF pgss_a - 1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE OF pgss_b - 1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE OF pgss_b, pgss_a - 1 | SELECT * FROM pgss_a JOIN pgss_b ON pgss_b.a_id = pgss_a.id FOR UPDATE SKIP LOCKED - 0 | SELECT calls, query FROM pg_stat_statements ORDER BY query COLLATE "C" - 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(12 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, query FROM pg_stat_statements ORDER BY query C... + ^ DROP TABLE pgss_a, pgss_b CASCADE; -- -- access to pg_stat_statements_info view -- SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. SELECT dealloc FROM pg_stat_statements_info; - dealloc ---------- - 0 -(1 row) - +ERROR: relation "pg_stat_statements_info" does not exist +LINE 1: SELECT dealloc FROM pg_stat_statements_info; + ^ -- FROM [ONLY] CREATE TABLE tbl_inh(id integer); CREATE TABLE tbl_inh_1() INHERITS (tbl_inh); @@ -271,11 +235,9 @@ (0 rows) SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%FROM%tbl_inh%'; - count -------- - 2 -(1 row) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%F... + ^ -- WITH TIES CREATE TABLE limitoption AS SELECT 0 AS val FROM generate_series(1, 10); SELECT * @@ -309,11 +271,9 @@ (2 rows) SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%FETCH FIRST%'; - count -------- - 2 -(1 row) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%F... + ^ -- GROUP BY [DISTINCT] SELECT a, b, c FROM (VALUES (1, 2, 3), (4, NULL, 6), (7, 8, 9)) AS t (a, b, c) @@ -370,11 +330,9 @@ (13 rows) SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%GROUP BY%ROLLUP%'; - count -------- - 2 -(1 row) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%G... + ^ -- GROUPING SET agglevelsup SELECT ( SELECT ( @@ -401,14 +359,11 @@ (3 rows) SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%SELECT GROUPING%'; - count -------- - 2 -(1 row) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT COUNT(*) FROM pg_stat_statements WHERE query LIKE '%S... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. diff -U3 /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/dml.out /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/dml.out --- /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/dml.out 2024-09-10 10:45:56.250093000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/dml.out 2024-09-10 10:49:21.872782000 +0000 @@ -73,26 +73,14 @@ (8 rows) SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+--------------------------------------------------------------------- - 1 | 1 | DELETE FROM pgss_dml_tab WHERE a > $1 - 1 | 3 | INSERT INTO pgss_dml_tab (a, b) VALUES ($1, $2), ($3, $4), ($5, $6) - 1 | 10 | INSERT INTO pgss_dml_tab VALUES(generate_series($1, $2), $3) - 1 | 12 | SELECT * FROM pgss_dml_tab ORDER BY a - 2 | 4 | SELECT * FROM pgss_dml_tab WHERE a > $1 ORDER BY a - 1 | 8 | SELECT * FROM pgss_dml_tab WHERE a IN ($1, $2, $3, $4, $5) - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t - 1 | 0 | SET pg_stat_statements.track_utility = FALSE - 6 | 6 | UPDATE pgss_dml_tab SET b = $1 WHERE a = $2 - 1 | 3 | UPDATE pgss_dml_tab SET b = $1 WHERE a > $2 -(10 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- MERGE MERGE INTO pgss_dml_tab USING pgss_dml_tab st ON (st.a = pgss_dml_tab.a AND st.a >= 4) WHEN MATCHED THEN UPDATE SET b = st.b || st.a::text; @@ -116,38 +104,17 @@ WHEN NOT MATCHED THEN DO NOTHING; DROP TABLE pgss_dml_tab; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+----------------------------------------------------------------------------------------- - 1 | 6 | MERGE INTO pgss_dml_tab USING pgss_dml_tab st ON (st.a = pgss_dml_tab.a AND st.a >= $1)+ - | | WHEN MATCHED AND length(st.b) > $2 THEN UPDATE SET b = pgss_dml_tab.b || st.a::text - 1 | 6 | MERGE INTO pgss_dml_tab USING pgss_dml_tab st ON (st.a = pgss_dml_tab.a AND st.a >= $1)+ - | | WHEN MATCHED THEN DELETE - 1 | 0 | MERGE INTO pgss_dml_tab USING pgss_dml_tab st ON (st.a = pgss_dml_tab.a AND st.a >= $1)+ - | | WHEN MATCHED THEN DO NOTHING - 1 | 6 | MERGE INTO pgss_dml_tab USING pgss_dml_tab st ON (st.a = pgss_dml_tab.a AND st.a >= $1)+ - | | WHEN MATCHED THEN UPDATE SET b = pgss_dml_tab.b || st.a::text - 1 | 6 | MERGE INTO pgss_dml_tab USING pgss_dml_tab st ON (st.a = pgss_dml_tab.a AND st.a >= $1)+ - | | WHEN MATCHED THEN UPDATE SET b = st.b || st.a::text - 1 | 0 | MERGE INTO pgss_dml_tab USING pgss_dml_tab st ON (st.a = pgss_dml_tab.a AND st.a >= $1)+ - | | WHEN NOT MATCHED THEN DO NOTHING - 1 | 0 | MERGE INTO pgss_dml_tab USING pgss_dml_tab st ON (st.a = pgss_dml_tab.a) + - | | WHEN NOT MATCHED THEN INSERT (a) VALUES ($1) - 2 | 0 | MERGE INTO pgss_dml_tab USING pgss_dml_tab st ON (st.a = pgss_dml_tab.a) + - | | WHEN NOT MATCHED THEN INSERT (a, b) VALUES ($1, $2) - 1 | 0 | MERGE INTO pgss_dml_tab USING pgss_dml_tab st ON (st.a = pgss_dml_tab.a) + - | | WHEN NOT MATCHED THEN INSERT (b, a) VALUES ($1, $2) - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(10 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ -- check that [temp] table relation extensions are tracked as writes CREATE TABLE pgss_extend_tab (a int, b text); CREATE TEMP TABLE pgss_extend_temp_tab (a int, b text); SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. INSERT INTO pgss_extend_tab (a, b) SELECT generate_series(1, 1000), 'something'; INSERT INTO pgss_extend_temp_tab (a, b) SELECT generate_series(1, 1000), 'something'; WITH sizes AS ( @@ -161,14 +128,11 @@ SUM(shared_blks_written) >= (SELECT rel_size FROM sizes) AS written_ok, SUM(shared_blks_dirtied) >= (SELECT rel_size FROM sizes) AS dirtied_ok FROM pg_stat_statements; - temp_written_ok | temp_dirtied_ok | written_ok | dirtied_ok ------------------+-----------------+------------+------------ - t | t | t | t -(1 row) - +ERROR: relation "pg_stat_statements" does not exist +LINE 11: FROM pg_stat_statements; + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. diff -U3 /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/cursors.out /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/cursors.out --- /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/cursors.out 2024-09-10 10:45:56.249964000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/cursors.out 2024-09-10 10:49:21.948870000 +0000 @@ -4,11 +4,10 @@ -- These tests require track_utility to be enabled. SET pg_stat_statements.track_utility = TRUE; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- DECLARE -- SELECT is normalized. DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT 1; @@ -16,19 +15,14 @@ DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT 2; CLOSE cursor_stats_1; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+------------------------------------------------------- - 2 | 0 | CLOSE cursor_stats_1 - 2 | 0 | DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT $1 - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(3 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- FETCH BEGIN; DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT 2; @@ -49,22 +43,11 @@ CLOSE cursor_stats_2; COMMIT; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+------------------------------------------------------- - 1 | 0 | BEGIN - 1 | 0 | CLOSE cursor_stats_1 - 1 | 0 | CLOSE cursor_stats_2 - 1 | 0 | COMMIT - 1 | 0 | DECLARE cursor_stats_1 CURSOR WITH HOLD FOR SELECT $1 - 1 | 0 | DECLARE cursor_stats_2 CURSOR WITH HOLD FOR SELECT $1 - 1 | 1 | FETCH 1 IN cursor_stats_1 - 1 | 1 | FETCH 1 IN cursor_stats_2 - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(9 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. diff -U3 /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/utility.out /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/utility.out --- /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/utility.out 2024-09-10 10:45:56.251505000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/utility.out 2024-09-10 10:49:22.197651000 +0000 @@ -4,11 +4,10 @@ -- These tests require track_utility to be enabled. SET pg_stat_statements.track_utility = TRUE; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- Tables, indexes, triggers CREATE TEMP TABLE tab_stats (a int, b char(20)); CREATE INDEX index_stats ON tab_stats(b, (b || 'data1'), (b || 'data2')) WHERE a > 0; @@ -24,24 +23,14 @@ NOTICE: table "tab_stats" does not exist, skipping NOTICE: table "tab_stats" does not exist, skipping NOTICE: table "tab_stats" does not exist, skipping - calls | rows | query --------+------+-------------------------------------------------------------------------------------- - 1 | 0 | ALTER TABLE tab_stats ADD CONSTRAINT a_nonzero CHECK (a <> 0) - 1 | 0 | ALTER TABLE tab_stats ALTER COLUMN b TYPE text USING 'data' || b - 1 | 0 | ALTER TABLE tab_stats ALTER COLUMN b set default 'a' - 1 | 0 | CREATE INDEX index_stats ON tab_stats(b, (b || 'data1'), (b || 'data2')) WHERE a > 0 - 1 | 0 | CREATE TEMP TABLE tab_stats (a int, b char(20)) - 3 | 0 | DROP TABLE IF EXISTS tab_stats - 1 | 0 | DROP TABLE tab_stats - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(8 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 6: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- Partitions CREATE TABLE pt_stats (a int, b int) PARTITION BY range (a); CREATE TABLE pt_stats1 (a int, b int); @@ -96,61 +85,14 @@ CREATE STATISTICS tab_expr_stats_1 (mcv) ON a, (2*a), (3*b) FROM tab_expr_stats; DROP TABLE tab_expr_stats; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+------------------------------------------------------------------------------------- - 1 | 0 | ALTER FOREIGN TABLE foreign_stats ADD COLUMN b integer DEFAULT 1 - 1 | 0 | ALTER FOREIGN TABLE foreign_stats ADD CONSTRAINT b_nonzero CHECK (b <> 0) - 1 | 0 | ALTER INDEX pt_stats_index ATTACH PARTITION pt_stats2_index - 1 | 0 | ALTER TABLE pt_stats ATTACH PARTITION pt_stats1 FOR VALUES FROM (0) TO (100) - 1 | 0 | ALTER VIEW view_stats ALTER COLUMN a SET DEFAULT 2 - 1 | 0 | CREATE FOREIGN DATA WRAPPER wrapper_stats - 1 | 0 | CREATE FOREIGN TABLE foreign_stats (a int) SERVER server_stats - 1 | 0 | CREATE FUNCTION func_stats(a text DEFAULT 'a_data', b text DEFAULT lower('b_data'))+ - | | RETURNS text AS $$ SELECT $1::text || '_' || $2::text; $$ LANGUAGE SQL - 1 | 0 | CREATE FUNCTION trigger_func_stats () RETURNS trigger LANGUAGE plpgsql + - | | AS $$ BEGIN return OLD; end; $$ - 1 | 0 | CREATE INDEX pt_stats2_index ON ONLY pt_stats2 (a) - 1 | 0 | CREATE INDEX pt_stats_index ON ONLY pt_stats (a) - 1 | 0 | CREATE POLICY policy_stats ON tab_policy_stats USING (a = 5) WITH CHECK (b < 5) - 1 | 0 | CREATE RULE rules_stats AS ON INSERT TO tab_rule_stats DO INSTEAD + - | | INSERT INTO tab_rule_stats_2 VALUES(new.*, 1, 2) - 1 | 0 | CREATE SERVER server_stats FOREIGN DATA WRAPPER wrapper_stats - 1 | 0 | CREATE STATISTICS tab_expr_stats_1 (mcv) ON a, (2*a), (3*b) FROM tab_expr_stats - 1 | 0 | CREATE TABLE pt_stats (a int, b int) PARTITION BY range (a) - 1 | 0 | CREATE TABLE pt_stats1 (a int, b int) - 1 | 0 | CREATE TABLE pt_stats2 PARTITION OF pt_stats FOR VALUES FROM (100) TO (200) - 1 | 0 | CREATE TABLE tab_expr_stats (a int, b int) - 1 | 0 | CREATE TABLE tab_policy_stats (a int, b int) - 1 | 0 | CREATE TABLE tab_rule_stats (a int, b int) - 1 | 0 | CREATE TABLE tab_rule_stats_2 (a int, b int, c int, d int) - 1 | 0 | CREATE TABLE trigger_tab_stats (a int, b int) - 1 | 0 | CREATE TRIGGER trigger_tab_stats + - | | AFTER UPDATE ON trigger_tab_stats + - | | FOR EACH ROW WHEN (OLD.a < 0 AND OLD.b < 1 AND true) + - | | EXECUTE FUNCTION trigger_func_stats() - 1 | 0 | CREATE TYPE stats_type as (f1 numeric(35, 6), f2 numeric(35, 2)) - 1 | 0 | CREATE VIEW view_stats AS SELECT 1::int AS a, 2::int AS b - 1 | 0 | DROP FOREIGN DATA WRAPPER wrapper_stats - 1 | 0 | DROP FOREIGN TABLE foreign_stats - 1 | 0 | DROP FUNCTION func_stats - 1 | 0 | DROP RULE rules_stats ON tab_rule_stats - 1 | 0 | DROP SERVER server_stats - 1 | 0 | DROP TABLE pt_stats - 1 | 0 | DROP TABLE tab_expr_stats - 1 | 0 | DROP TABLE tab_policy_stats - 1 | 0 | DROP TABLE tab_rule_stats, tab_rule_stats_2 - 1 | 0 | DROP TABLE trigger_tab_stats - 1 | 0 | DROP TYPE stats_type - 1 | 0 | DROP VIEW view_stats - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(39 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- Transaction statements BEGIN; ABORT; @@ -179,24 +121,14 @@ BEGIN TRANSACTION NOT DEFERRABLE, READ ONLY, READ WRITE, DEFERRABLE; COMMIT; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+--------------------------------------------------------------------- - 4 | 0 | ABORT - 6 | 0 | BEGIN - 2 | 0 | BEGIN ISOLATION LEVEL SERIALIZABLE - 1 | 0 | BEGIN TRANSACTION DEFERRABLE - 1 | 0 | BEGIN TRANSACTION NOT DEFERRABLE, READ ONLY, READ WRITE, DEFERRABLE - 1 | 0 | BEGIN TRANSACTION READ ONLY, READ WRITE, DEFERRABLE, NOT DEFERRABLE - 7 | 0 | COMMIT WORK - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(8 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- Two-phase transactions BEGIN; PREPARE TRANSACTION 'stat_trans1'; @@ -205,21 +137,14 @@ PREPARE TRANSACTION 'stat_trans2'; ROLLBACK PREPARED 'stat_trans2'; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+---------------------------------------------------- - 2 | 0 | BEGIN - 1 | 0 | COMMIT PREPARED $1 - 2 | 0 | PREPARE TRANSACTION $1 - 1 | 0 | ROLLBACK PREPARED $1 - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(5 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- Savepoints BEGIN; SAVEPOINT sp1; @@ -235,22 +160,14 @@ RELEASE SAVEPOINT sp1; COMMIT; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+---------------------------------------------------- - 1 | 0 | BEGIN - 1 | 0 | COMMIT - 3 | 0 | RELEASE $1 - 4 | 0 | ROLLBACK TO $1 - 4 | 0 | SAVEPOINT $1 - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(6 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- EXPLAIN statements -- A Query is used, normalized by the query jumbling. EXPLAIN (costs off) SELECT 1; @@ -280,13 +197,9 @@ (2 rows) SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+--------------------------------------------------------------------------------- - 2 | 0 | EXPLAIN (costs off) SELECT $1 - 2 | 0 | EXPLAIN (costs off) SELECT a FROM generate_series($1,$2) AS tab(a) WHERE a = $3 - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(3 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ -- CALL CREATE OR REPLACE PROCEDURE sum_one(i int) AS $$ DECLARE @@ -322,11 +235,10 @@ i3 := i3 + i; END; $$ LANGUAGE plpgsql; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. CALL sum_one(3); CALL sum_one(199); CALL sum_two(1,1); @@ -346,24 +258,16 @@ (1 row) SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+---------------------------------------------------- - 2 | 0 | CALL in_out($1, $2, $3) - 1 | 0 | CALL overload($1) - 1 | 0 | CALL overload($1) - 2 | 0 | CALL sum_one($1) - 2 | 0 | CALL sum_two($1,$2) - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(6 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ -- COPY CREATE TABLE copy_stats (a int, b int); SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- Some queries with A_Const nodes. COPY (SELECT 1) TO STDOUT; 1 @@ -382,25 +286,15 @@ COPY (DELETE FROM copy_stats WHERE a = 1 RETURNING *) TO STDOUT; 1 4 SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+------------------------------------------------------------------- - 1 | 1 | COPY (DELETE FROM copy_stats WHERE a = 1 RETURNING *) TO STDOUT - 1 | 1 | COPY (INSERT INTO copy_stats VALUES (1, 1) RETURNING *) TO STDOUT - 1 | 1 | COPY (INSERT INTO copy_stats VALUES (2, 2) RETURNING *) TO STDOUT - 1 | 1 | COPY (SELECT 1) TO STDOUT - 1 | 1 | COPY (SELECT 2) TO STDOUT - 1 | 2 | COPY (UPDATE copy_stats SET b = b + 1 RETURNING *) TO STDOUT - 1 | 2 | COPY (UPDATE copy_stats SET b = b + 2 RETURNING *) TO STDOUT - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(8 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ DROP TABLE copy_stats; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- CREATE TABLE AS -- SELECT queries are normalized, creating matching query IDs. CREATE TABLE ctas_stats_1 AS SELECT 1 AS a; @@ -416,23 +310,14 @@ FROM generate_series(1, 5) AS tab(a) WHERE a < 4 AND a > 1; DROP TABLE ctas_stats_2; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+-------------------------------------------------------------------- - 2 | 2 | CREATE TABLE ctas_stats_1 AS SELECT $1 AS a - 2 | 4 | CREATE TABLE ctas_stats_2 AS + - | | SELECT a AS col1, $1::int AS col2 + - | | FROM generate_series($2, $3) AS tab(a) WHERE a < $4 AND a > $5 - 2 | 0 | DROP TABLE ctas_stats_1 - 2 | 0 | DROP TABLE ctas_stats_2 - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(5 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- CREATE MATERIALIZED VIEW -- SELECT queries are normalized, creating matching query IDs. CREATE MATERIALIZED VIEW matview_stats_1 AS @@ -444,21 +329,14 @@ FROM generate_series(1, 5) AS tab(a) WHERE a < 4 AND a > 3; DROP MATERIALIZED VIEW matview_stats_1; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+-------------------------------------------------------------------- - 2 | 2 | CREATE MATERIALIZED VIEW matview_stats_1 AS + - | | SELECT a AS col1, $1::int AS col2 + - | | FROM generate_series($2, $3) AS tab(a) WHERE a < $4 AND a > $5 - 2 | 0 | DROP MATERIALIZED VIEW matview_stats_1 - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(3 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- CREATE VIEW CREATE VIEW view_stats_1 AS SELECT a AS col1, 2::int AS col2 @@ -469,45 +347,28 @@ FROM generate_series(1, 5) AS tab(a) WHERE a < 4 AND a > 3; DROP VIEW view_stats_1; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+----------------------------------------------------------------- - 1 | 0 | CREATE VIEW view_stats_1 AS + - | | SELECT a AS col1, 2::int AS col2 + - | | FROM generate_series(1, 10) AS tab(a) WHERE a < 5 AND a > 2 - 1 | 0 | CREATE VIEW view_stats_1 AS + - | | SELECT a AS col1, 4::int AS col2 + - | | FROM generate_series(1, 5) AS tab(a) WHERE a < 4 AND a > 3 - 2 | 0 | DROP VIEW view_stats_1 - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(4 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- Domains CREATE DOMAIN domain_stats AS int CHECK (VALUE > 0); ALTER DOMAIN domain_stats SET DEFAULT '3'; ALTER DOMAIN domain_stats ADD CONSTRAINT higher_than_one CHECK (VALUE > 1); DROP DOMAIN domain_stats; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+---------------------------------------------------------------------------- - 1 | 0 | ALTER DOMAIN domain_stats ADD CONSTRAINT higher_than_one CHECK (VALUE > 1) - 1 | 0 | ALTER DOMAIN domain_stats SET DEFAULT '3' - 1 | 0 | CREATE DOMAIN domain_stats AS int CHECK (VALUE > 0) - 1 | 0 | DROP DOMAIN domain_stats - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(5 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- Execution statements SELECT 1 as a; a @@ -534,21 +395,14 @@ DEALLOCATE ALL; DEALLOCATE PREPARE ALL; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+---------------------------------------------------- - 2 | 0 | DEALLOCATE $1 - 2 | 0 | DEALLOCATE ALL - 2 | 2 | PREPARE stat_select AS SELECT $1 AS a - 1 | 1 | SELECT $1 as a - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(5 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- SET statements. -- These use two different strings, still they count as one entry. SET work_mem = '1MB'; @@ -572,31 +426,14 @@ RESET SESSION AUTHORIZATION; COMMIT; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+---------------------------------------------------- - 2 | 0 | BEGIN - 2 | 0 | COMMIT - 2 | 0 | RESET SESSION AUTHORIZATION - 1 | 0 | RESET enable_seqscan - 1 | 0 | RESET work_mem - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t - 1 | 0 | SET LOCAL SESSION AUTHORIZATION DEFAULT - 1 | 0 | SET SESSION SESSION AUTHORIZATION DEFAULT - 1 | 0 | SET TRANSACTION ISOLATION LEVEL READ COMMITTED - 1 | 0 | SET TRANSACTION ISOLATION LEVEL REPEATABLE READ - 1 | 0 | SET TRANSACTION ISOLATION LEVEL SERIALIZABLE - 1 | 0 | SET enable_seqscan = off - 1 | 0 | SET enable_seqscan = on - 2 | 0 | SET work_mem = '1MB' - 1 | 0 | SET work_mem = '2MB' -(15 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- -- Track the total number of rows retrieved or affected by the utility -- commands of COPY, FETCH, CREATE TABLE AS, CREATE MATERIALIZED VIEW, @@ -639,28 +476,14 @@ COMMIT; SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+------------------------------------------------------------------------- - 1 | 0 | BEGIN - 1 | 0 | COMMIT - 1 | 3 | COPY pgss_ctas (a, b) FROM STDIN - 1 | 13 | CREATE MATERIALIZED VIEW pgss_matv AS SELECT * FROM pgss_ctas - 1 | 10 | CREATE TABLE pgss_ctas AS SELECT a, $1 b FROM generate_series($2, $3) a - 1 | 0 | DECLARE pgss_cursor CURSOR FOR SELECT * FROM pgss_matv - 1 | 5 | FETCH FORWARD 5 pgss_cursor - 1 | 7 | FETCH FORWARD ALL pgss_cursor - 1 | 1 | FETCH NEXT pgss_cursor - 1 | 13 | REFRESH MATERIALIZED VIEW pgss_matv - 1 | 10 | SELECT generate_series($1, $2) c INTO pgss_select_into - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(12 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ DROP MATERIALIZED VIEW pgss_matv; DROP TABLE pgss_ctas; DROP TABLE pgss_select_into; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. diff -U3 /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/level_tracking.out /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/level_tracking.out --- /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/level_tracking.out 2024-09-10 10:45:56.250330000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/level_tracking.out 2024-09-10 10:49:22.230175000 +0000 @@ -3,11 +3,10 @@ -- SET pg_stat_statements.track_utility = TRUE; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- DO block - top-level tracking. CREATE TABLE stats_track_tab (x int); SET pg_stat_statements.track = 'top'; @@ -19,22 +18,14 @@ $$ LANGUAGE plpgsql; SELECT toplevel, calls, query FROM pg_stat_statements WHERE query LIKE '%DELETE%' ORDER BY query COLLATE "C", toplevel; - toplevel | calls | query -----------+-------+-------------------------------- - t | 1 | DELETE FROM stats_track_tab - t | 1 | DO $$ + - | | BEGIN + - | | DELETE FROM stats_track_tab;+ - | | END; + - | | $$ LANGUAGE plpgsql -(2 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT toplevel, calls, query FROM pg_stat_statements + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- DO block - all-level tracking. SET pg_stat_statements.track = 'all'; DELETE FROM stats_track_tab; @@ -49,24 +40,9 @@ END; $$; SELECT toplevel, calls, query FROM pg_stat_statements ORDER BY query COLLATE "C", toplevel; - toplevel | calls | query -----------+-------+---------------------------------------------------- - f | 1 | DELETE FROM stats_track_tab - t | 1 | DELETE FROM stats_track_tab - t | 1 | DO $$ + - | | BEGIN + - | | DELETE FROM stats_track_tab; + - | | END; $$ - t | 1 | DO LANGUAGE plpgsql $$ + - | | BEGIN + - | | -- this is a SELECT + - | | PERFORM 'hello world'::TEXT; + - | | END; $$ - f | 1 | SELECT $1::TEXT - t | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t - t | 1 | SET pg_stat_statements.track = 'all' -(7 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT toplevel, calls, query FROM pg_stat_statements + ^ -- Procedure with multiple utility statements. CREATE OR REPLACE PROCEDURE proc_with_utility_stmt() LANGUAGE SQL @@ -79,48 +55,37 @@ -- all-level tracking. SET pg_stat_statements.track = 'all'; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. CALL proc_with_utility_stmt(); SELECT toplevel, calls, query FROM pg_stat_statements ORDER BY query COLLATE "C", toplevel; - toplevel | calls | query -----------+-------+---------------------------------------------------- - t | 1 | CALL proc_with_utility_stmt() - t | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t - f | 2 | SHOW pg_stat_statements.track - f | 1 | SHOW pg_stat_statements.track_utility -(4 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT toplevel, calls, query FROM pg_stat_statements + ^ -- top-level tracking. SET pg_stat_statements.track = 'top'; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. CALL proc_with_utility_stmt(); SELECT toplevel, calls, query FROM pg_stat_statements ORDER BY query COLLATE "C", toplevel; - toplevel | calls | query -----------+-------+---------------------------------------------------- - t | 1 | CALL proc_with_utility_stmt() - t | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(2 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT toplevel, calls, query FROM pg_stat_statements + ^ -- DO block - top-level tracking without utility. SET pg_stat_statements.track = 'top'; SET pg_stat_statements.track_utility = FALSE; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. DELETE FROM stats_track_tab; DO $$ BEGIN @@ -133,20 +98,16 @@ END; $$; SELECT toplevel, calls, query FROM pg_stat_statements ORDER BY query COLLATE "C", toplevel; - toplevel | calls | query -----------+-------+---------------------------------------------------- - t | 1 | DELETE FROM stats_track_tab - t | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(2 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT toplevel, calls, query FROM pg_stat_statements + ^ -- DO block - all-level tracking without utility. SET pg_stat_statements.track = 'all'; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. DELETE FROM stats_track_tab; DO $$ BEGIN @@ -159,23 +120,17 @@ END; $$; SELECT toplevel, calls, query FROM pg_stat_statements ORDER BY query COLLATE "C", toplevel; - toplevel | calls | query -----------+-------+---------------------------------------------------- - f | 1 | DELETE FROM stats_track_tab - t | 1 | DELETE FROM stats_track_tab - f | 1 | SELECT $1::TEXT - t | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(4 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT toplevel, calls, query FROM pg_stat_statements + ^ -- PL/pgSQL function - top-level tracking. SET pg_stat_statements.track = 'top'; SET pg_stat_statements.track_utility = FALSE; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. CREATE FUNCTION PLUS_TWO(i INTEGER) RETURNS INTEGER AS $$ DECLARE r INTEGER; @@ -211,13 +166,9 @@ (1 row) SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+---------------------------------------------------- - 2 | 2 | SELECT PLUS_ONE($1) - 2 | 2 | SELECT PLUS_TWO($1) - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(3 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ -- immutable SQL function --- can be executed at plan time CREATE FUNCTION PLUS_THREE(i INTEGER) RETURNS INTEGER AS $$ SELECT i + 3 LIMIT 1 $$ IMMUTABLE LANGUAGE SQL; @@ -234,23 +185,16 @@ (1 row) SELECT toplevel, calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - toplevel | calls | rows | query -----------+-------+------+------------------------------------------------------------------------------ - t | 2 | 2 | SELECT PLUS_ONE($1) - t | 2 | 2 | SELECT PLUS_THREE($1) - t | 2 | 2 | SELECT PLUS_TWO($1) - t | 1 | 3 | SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C" - t | 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(5 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT toplevel, calls, rows, query FROM pg_stat_statements ... + ^ -- PL/pgSQL function - all-level tracking. SET pg_stat_statements.track = 'all'; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- we drop and recreate the functions to avoid any caching funnies DROP FUNCTION PLUS_ONE(INTEGER); DROP FUNCTION PLUS_TWO(INTEGER); @@ -291,15 +235,9 @@ (1 row) SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+---------------------------------------------------- - 2 | 2 | SELECT (i + $2 + $3)::INTEGER - 2 | 2 | SELECT (i + $2)::INTEGER LIMIT $3 - 2 | 2 | SELECT PLUS_ONE($1) - 2 | 2 | SELECT PLUS_TWO($1) - 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(5 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ -- immutable SQL function --- can be executed at plan time CREATE FUNCTION PLUS_THREE(i INTEGER) RETURNS INTEGER AS $$ SELECT i + 3 LIMIT 1 $$ IMMUTABLE LANGUAGE SQL; @@ -316,28 +254,18 @@ (1 row) SELECT toplevel, calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - toplevel | calls | rows | query -----------+-------+------+------------------------------------------------------------------------------ - f | 2 | 2 | SELECT (i + $2 + $3)::INTEGER - f | 2 | 2 | SELECT (i + $2)::INTEGER LIMIT $3 - t | 2 | 2 | SELECT PLUS_ONE($1) - t | 2 | 2 | SELECT PLUS_THREE($1) - t | 2 | 2 | SELECT PLUS_TWO($1) - t | 1 | 5 | SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C" - f | 2 | 2 | SELECT i + $2 LIMIT $3 - t | 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t -(8 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT toplevel, calls, rows, query FROM pg_stat_statements ... + ^ -- -- pg_stat_statements.track = none -- SET pg_stat_statements.track = 'none'; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. SELECT 1 AS "one"; one ----- @@ -351,13 +279,11 @@ (1 row) SELECT calls, rows, query FROM pg_stat_statements ORDER BY query COLLATE "C"; - calls | rows | query --------+------+------- -(0 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT calls, rows, query FROM pg_stat_statements ORDER BY q... + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. diff -U3 /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/planning.out /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/planning.out --- /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/planning.out 2024-09-10 10:45:56.250844000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/planning.out 2024-09-10 10:49:22.251071000 +0000 @@ -4,11 +4,10 @@ -- These tests require track_planning to be enabled. SET pg_stat_statements.track_planning = TRUE; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- -- [re]plan counting -- @@ -59,30 +58,20 @@ SELECT plans, calls, rows, query FROM pg_stat_statements WHERE query NOT LIKE 'PREPARE%' ORDER BY query COLLATE "C"; - plans | calls | rows | query --------+-------+------+---------------------------------------------------------- - 0 | 1 | 0 | ALTER TABLE stats_plan_test ADD COLUMN x int - 0 | 1 | 0 | CREATE TABLE stats_plan_test () - 3 | 3 | 3 | SELECT $1 - 0 | 1 | 1 | SELECT pg_stat_statements_reset() IS NOT NULL AS t - 1 | 0 | 0 | SELECT plans, calls, rows, query FROM pg_stat_statements+ - | | | WHERE query NOT LIKE $1 ORDER BY query COLLATE "C" -(5 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT plans, calls, rows, query FROM pg_stat_statements + ^ -- for the prepared statement we expect at least one replan, but cache -- invalidations could force more SELECT plans >= 2 AND plans <= calls AS plans_ok, calls, rows, query FROM pg_stat_statements WHERE query LIKE 'PREPARE%' ORDER BY query COLLATE "C"; - plans_ok | calls | rows | query -----------+-------+------+------------------------------------------------------- - t | 4 | 4 | PREPARE prep1 AS SELECT COUNT(*) FROM stats_plan_test -(1 row) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: ...ans <= calls AS plans_ok, calls, rows, query FROM pg_stat_st... + ^ -- Cleanup DROP TABLE stats_plan_test; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. diff -U3 /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/user_activity.out /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/user_activity.out --- /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/user_activity.out 2024-09-10 10:45:56.251197000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/user_activity.out 2024-09-10 10:49:22.324235000 +0000 @@ -3,11 +3,10 @@ -- SET pg_stat_statements.track_utility = TRUE; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. CREATE ROLE regress_stats_user1; CREATE ROLE regress_stats_user2; SET ROLE regress_stats_user1; @@ -39,46 +38,21 @@ RESET ROLE; SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C"; - query | calls | rows -----------------------------------------------------+-------+------ - CREATE ROLE regress_stats_user1 | 1 | 0 - CREATE ROLE regress_stats_user2 | 1 | 0 - RESET ROLE | 2 | 0 - SELECT $1 AS "ONE" | 1 | 1 - SELECT $1 AS "ONE" | 1 | 1 - SELECT $1+$2 AS "TWO" | 1 | 1 - SELECT $1+$2 AS "TWO" | 1 | 1 - SELECT pg_stat_statements_reset() IS NOT NULL AS t | 1 | 1 - SET ROLE regress_stats_user1 | 1 | 0 - SET ROLE regress_stats_user2 | 1 | 0 -(10 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT query, calls, rows FROM pg_stat_statements ORDER BY q... + ^ -- -- Don't reset anything if any of the parameter is NULL -- SELECT pg_stat_statements_reset(NULL) IS NOT NULL AS t; - t ---- - f -(1 row) - +ERROR: function pg_stat_statements_reset(unknown) does not exist +LINE 1: SELECT pg_stat_statements_reset(NULL) IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C"; - query | calls | rows -------------------------------------------------------------------------------+-------+------ - CREATE ROLE regress_stats_user1 | 1 | 0 - CREATE ROLE regress_stats_user2 | 1 | 0 - RESET ROLE | 2 | 0 - SELECT $1 AS "ONE" | 1 | 1 - SELECT $1 AS "ONE" | 1 | 1 - SELECT $1+$2 AS "TWO" | 1 | 1 - SELECT $1+$2 AS "TWO" | 1 | 1 - SELECT pg_stat_statements_reset($1) IS NOT NULL AS t | 1 | 1 - SELECT pg_stat_statements_reset() IS NOT NULL AS t | 1 | 1 - SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C" | 1 | 10 - SET ROLE regress_stats_user1 | 1 | 0 - SET ROLE regress_stats_user2 | 1 | 0 -(12 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT query, calls, rows FROM pg_stat_statements ORDER BY q... + ^ -- -- remove query ('SELECT $1+$2 AS "TWO"') executed by regress_stats_user2 -- in the current_database @@ -89,121 +63,57 @@ (SELECT s.queryid FROM pg_stat_statements AS s WHERE s.query = 'SELECT $1+$2 AS "TWO"' LIMIT 1)) IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: relation "pg_stat_statements" does not exist +LINE 4: (SELECT s.queryid FROM pg_stat_statements AS s + ^ SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C"; - query | calls | rows -----------------------------------------------------------------------------------+-------+------ - CREATE ROLE regress_stats_user1 | 1 | 0 - CREATE ROLE regress_stats_user2 | 1 | 0 - RESET ROLE | 2 | 0 - SELECT $1 AS "ONE" | 1 | 1 - SELECT $1 AS "ONE" | 1 | 1 - SELECT $1+$2 AS "TWO" | 1 | 1 - SELECT pg_stat_statements_reset( +| 1 | 1 - (SELECT r.oid FROM pg_roles AS r WHERE r.rolname = $1), +| | - (SELECT d.oid FROM pg_database As d where datname = current_database()),+| | - (SELECT s.queryid FROM pg_stat_statements AS s +| | - WHERE s.query = $2 LIMIT $3)) +| | - IS NOT NULL AS t | | - SELECT pg_stat_statements_reset($1) IS NOT NULL AS t | 1 | 1 - SELECT pg_stat_statements_reset() IS NOT NULL AS t | 1 | 1 - SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C" | 2 | 22 - SET ROLE regress_stats_user1 | 1 | 0 - SET ROLE regress_stats_user2 | 1 | 0 -(12 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT query, calls, rows FROM pg_stat_statements ORDER BY q... + ^ -- -- remove query ('SELECT $1 AS "ONE"') executed by two users -- SELECT pg_stat_statements_reset(0,0,s.queryid) IS NOT NULL AS t FROM pg_stat_statements AS s WHERE s.query = 'SELECT $1 AS "ONE"'; - t ---- - t - t -(2 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 2: FROM pg_stat_statements AS s WHERE s.query = 'SELECT $1 AS ... + ^ SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C"; - query | calls | rows -----------------------------------------------------------------------------------+-------+------ - CREATE ROLE regress_stats_user1 | 1 | 0 - CREATE ROLE regress_stats_user2 | 1 | 0 - RESET ROLE | 2 | 0 - SELECT $1+$2 AS "TWO" | 1 | 1 - SELECT pg_stat_statements_reset( +| 1 | 1 - (SELECT r.oid FROM pg_roles AS r WHERE r.rolname = $1), +| | - (SELECT d.oid FROM pg_database As d where datname = current_database()),+| | - (SELECT s.queryid FROM pg_stat_statements AS s +| | - WHERE s.query = $2 LIMIT $3)) +| | - IS NOT NULL AS t | | - SELECT pg_stat_statements_reset($1) IS NOT NULL AS t | 1 | 1 - SELECT pg_stat_statements_reset($1,$2,s.queryid) IS NOT NULL AS t +| 1 | 2 - FROM pg_stat_statements AS s WHERE s.query = $3 | | - SELECT pg_stat_statements_reset() IS NOT NULL AS t | 1 | 1 - SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C" | 3 | 34 - SET ROLE regress_stats_user1 | 1 | 0 - SET ROLE regress_stats_user2 | 1 | 0 -(11 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT query, calls, rows FROM pg_stat_statements ORDER BY q... + ^ -- -- remove query of a user (regress_stats_user1) -- SELECT pg_stat_statements_reset(r.oid) IS NOT NULL AS t FROM pg_roles AS r WHERE r.rolname = 'regress_stats_user1'; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset(oid) does not exist +LINE 1: SELECT pg_stat_statements_reset(r.oid) IS NOT NULL AS t + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C"; - query | calls | rows -----------------------------------------------------------------------------------+-------+------ - CREATE ROLE regress_stats_user1 | 1 | 0 - CREATE ROLE regress_stats_user2 | 1 | 0 - RESET ROLE | 2 | 0 - SELECT pg_stat_statements_reset( +| 1 | 1 - (SELECT r.oid FROM pg_roles AS r WHERE r.rolname = $1), +| | - (SELECT d.oid FROM pg_database As d where datname = current_database()),+| | - (SELECT s.queryid FROM pg_stat_statements AS s +| | - WHERE s.query = $2 LIMIT $3)) +| | - IS NOT NULL AS t | | - SELECT pg_stat_statements_reset($1) IS NOT NULL AS t | 1 | 1 - SELECT pg_stat_statements_reset($1,$2,s.queryid) IS NOT NULL AS t +| 1 | 2 - FROM pg_stat_statements AS s WHERE s.query = $3 | | - SELECT pg_stat_statements_reset() IS NOT NULL AS t | 1 | 1 - SELECT pg_stat_statements_reset(r.oid) IS NOT NULL AS t +| 1 | 1 - FROM pg_roles AS r WHERE r.rolname = $1 | | - SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C" | 4 | 45 - SET ROLE regress_stats_user2 | 1 | 0 -(10 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT query, calls, rows FROM pg_stat_statements ORDER BY q... + ^ -- -- reset all -- SELECT pg_stat_statements_reset(0,0,0) IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset(integer, integer, integer) does not exist +LINE 1: SELECT pg_stat_statements_reset(0,0,0) IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE "C"; - query | calls | rows ----------------------------------------------------------+-------+------ - SELECT pg_stat_statements_reset(0,0,0) IS NOT NULL AS t | 1 | 1 -(1 row) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: SELECT query, calls, rows FROM pg_stat_statements ORDER BY q... + ^ -- -- cleanup -- DROP ROLE regress_stats_user1; DROP ROLE regress_stats_user2; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. diff -U3 /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/wal.out /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/wal.out --- /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/wal.out 2024-09-10 10:45:56.251589000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/wal.out 2024-09-10 10:49:22.350012000 +0000 @@ -13,18 +13,11 @@ wal_records > 0 as wal_records_generated, wal_records >= rows as wal_records_ge_rows FROM pg_stat_statements ORDER BY query COLLATE "C"; - query | calls | rows | wal_bytes_generated | wal_records_generated | wal_records_ge_rows ---------------------------------------------------------------+-------+------+---------------------+-----------------------+--------------------- - DELETE FROM pgss_wal_tab WHERE a > $1 | 1 | 1 | t | t | t - INSERT INTO pgss_wal_tab VALUES(generate_series($1, $2), $3) | 1 | 10 | t | t | t - SELECT pg_stat_statements_reset() IS NOT NULL AS t | 1 | 1 | f | f | f - SET pg_stat_statements.track_utility = FALSE | 1 | 0 | f | f | t - UPDATE pgss_wal_tab SET b = $1 WHERE a > $2 | 1 | 3 | t | t | t -(5 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 5: FROM pg_stat_statements ORDER BY query COLLATE "C"; + ^ SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. diff -U3 /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/entry_timestamp.out /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/entry_timestamp.out --- /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/entry_timestamp.out 2024-09-10 10:45:56.250189000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/entry_timestamp.out 2024-09-10 10:49:22.363139000 +0000 @@ -20,12 +20,9 @@ WHERE query LIKE '%STMTTS%' GROUP BY stats_since >= :'ref_ts' ORDER BY stats_since >= :'ref_ts'; - ?column? | count -----------+------- - f | 1 - t | 1 -(2 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 1: ...e Sep 10 03:49:22.361207 2024 PDT', count(*) FROM pg_stat_st... + ^ SELECT now() AS ref_ts \gset SELECT count(*) as total, @@ -43,15 +40,16 @@ ) as stats_since_after_ref FROM pg_stat_statements WHERE query LIKE '%STMTTS%'; - total | minmax_plan_zero | minmax_exec_zero | minmax_stats_since_after_ref | stats_since_after_ref --------+------------------+------------------+------------------------------+----------------------- - 2 | 0 | 0 | 0 | 0 -(1 row) - +ERROR: relation "pg_stat_statements" does not exist +LINE 15: FROM pg_stat_statements + ^ -- Perform single min/max reset SELECT pg_stat_statements_reset(0, 0, queryid, true) AS minmax_reset_ts FROM pg_stat_statements WHERE query LIKE '%STMTTS1%' \gset +ERROR: relation "pg_stat_statements" does not exist +LINE 2: FROM pg_stat_statements + ^ -- check SELECT count(*) as total, @@ -69,34 +67,31 @@ ) as stats_since_after_ref FROM pg_stat_statements WHERE query LIKE '%STMTTS%'; - total | minmax_plan_zero | minmax_exec_zero | minmax_stats_since_after_ref | stats_since_after_ref --------+------------------+------------------+------------------------------+----------------------- - 2 | 1 | 1 | 1 | 0 -(1 row) - +ERROR: relation "pg_stat_statements" does not exist +LINE 15: FROM pg_stat_statements + ^ -- check minmax reset timestamps SELECT query, minmax_stats_since = :'minmax_reset_ts' AS reset_ts_match FROM pg_stat_statements WHERE query LIKE '%STMTTS%' ORDER BY query COLLATE "C"; - query | reset_ts_match ----------------------------+---------------- - SELECT $1 AS "STMTTS1" | t - SELECT $1,$2 AS "STMTTS2" | f -(2 rows) - +ERROR: syntax error at or near ":" +LINE 2: query, minmax_stats_since = :'minmax_reset_ts' AS reset_ts_m... + ^ -- check that minmax reset does not set stats_reset SELECT stats_reset = :'minmax_reset_ts' AS stats_reset_ts_match FROM pg_stat_statements_info; - stats_reset_ts_match ----------------------- - f -(1 row) - +ERROR: syntax error at or near ":" +LINE 2: stats_reset = :'minmax_reset_ts' AS stats_reset_ts_match + ^ -- Perform common min/max reset SELECT pg_stat_statements_reset(0, 0, 0, true) AS minmax_reset_ts \gset +ERROR: function pg_stat_statements_reset(integer, integer, integer, boolean) does not exist +LINE 1: SELECT pg_stat_statements_reset(0, 0, 0, true) AS minmax_res... + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. -- check again SELECT count(*) as total, @@ -117,11 +112,9 @@ ) as stats_since_after_ref FROM pg_stat_statements WHERE query LIKE '%STMTTS%'; - total | minmax_plan_zero | minmax_exec_zero | minmax_ts_after_ref | minmax_ts_match | stats_since_after_ref --------+------------------+------------------+---------------------+-----------------+----------------------- - 2 | 2 | 2 | 2 | 2 | 0 -(1 row) - +ERROR: syntax error at or near ":" +LINE 13: WHERE minmax_stats_since = :'minmax_reset_ts' + ^ -- Execute first query once more to check stats update SELECT 1 AS "STMTTS1"; STMTTS1 @@ -145,15 +138,12 @@ ) as stats_since_after_ref FROM pg_stat_statements WHERE query LIKE '%STMTTS%'; - total | minmax_exec_zero | minmax_ts_after_ref | stats_since_after_ref --------+------------------+---------------------+----------------------- - 2 | 1 | 2 | 0 -(1 row) - +ERROR: relation "pg_stat_statements" does not exist +LINE 12: FROM pg_stat_statements + ^ -- Cleanup SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. diff -U3 /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/privileges.out /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/privileges.out --- /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/privileges.out 2024-09-10 10:45:56.250933000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/privileges.out 2024-09-10 10:49:22.402804000 +0000 @@ -10,11 +10,10 @@ GRANT pg_read_all_stats TO regress_stats_user2; SET ROLE regress_stats_superuser; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. SELECT 1 AS "ONE"; ONE ----- @@ -36,13 +35,9 @@ SELECT r.rolname, ss.queryid <> 0 AS queryid_bool, ss.query, ss.calls, ss.rows FROM pg_stat_statements ss JOIN pg_roles r ON ss.userid = r.oid ORDER BY r.rolname, ss.query COLLATE "C", ss.calls, ss.rows; - rolname | queryid_bool | query | calls | rows --------------------------+--------------+----------------------------------------------------+-------+------ - regress_stats_superuser | t | SELECT $1 AS "ONE" | 1 | 1 - regress_stats_superuser | t | SELECT pg_stat_statements_reset() IS NOT NULL AS t | 1 | 1 - regress_stats_user1 | t | SELECT $1+$2 AS "TWO" | 1 | 1 -(3 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 2: FROM pg_stat_statements ss JOIN pg_roles r ON ss.userid = ... + ^ -- -- regress_stats_user1 has no privileges to read the query text or -- queryid of queries executed by others but can see statistics @@ -52,14 +47,9 @@ SELECT r.rolname, ss.queryid <> 0 AS queryid_bool, ss.query, ss.calls, ss.rows FROM pg_stat_statements ss JOIN pg_roles r ON ss.userid = r.oid ORDER BY r.rolname, ss.query COLLATE "C", ss.calls, ss.rows; - rolname | queryid_bool | query | calls | rows --------------------------+--------------+--------------------------+-------+------ - regress_stats_superuser | | | 1 | 1 - regress_stats_superuser | | | 1 | 1 - regress_stats_superuser | | | 1 | 3 - regress_stats_user1 | t | SELECT $1+$2 AS "TWO" | 1 | 1 -(4 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 2: FROM pg_stat_statements ss JOIN pg_roles r ON ss.userid = ... + ^ -- -- regress_stats_user2, with pg_read_all_stats role privileges, can -- read all columns, including query text and queryid, of queries @@ -69,19 +59,9 @@ SELECT r.rolname, ss.queryid <> 0 AS queryid_bool, ss.query, ss.calls, ss.rows FROM pg_stat_statements ss JOIN pg_roles r ON ss.userid = r.oid ORDER BY r.rolname, ss.query COLLATE "C", ss.calls, ss.rows; - rolname | queryid_bool | query | calls | rows --------------------------+--------------+---------------------------------------------------------------------------------+-------+------ - regress_stats_superuser | t | SELECT $1 AS "ONE" | 1 | 1 - regress_stats_superuser | t | SELECT pg_stat_statements_reset() IS NOT NULL AS t | 1 | 1 - regress_stats_superuser | t | SELECT r.rolname, ss.queryid <> $1 AS queryid_bool, ss.query, ss.calls, ss.rows+| 1 | 3 - | | FROM pg_stat_statements ss JOIN pg_roles r ON ss.userid = r.oid +| | - | | ORDER BY r.rolname, ss.query COLLATE "C", ss.calls, ss.rows | | - regress_stats_user1 | t | SELECT $1+$2 AS "TWO" | 1 | 1 - regress_stats_user1 | t | SELECT r.rolname, ss.queryid <> $1 AS queryid_bool, ss.query, ss.calls, ss.rows+| 1 | 4 - | | FROM pg_stat_statements ss JOIN pg_roles r ON ss.userid = r.oid +| | - | | ORDER BY r.rolname, ss.query COLLATE "C", ss.calls, ss.rows | | -(5 rows) - +ERROR: relation "pg_stat_statements" does not exist +LINE 2: FROM pg_stat_statements ss JOIN pg_roles r ON ss.userid = ... + ^ -- -- cleanup -- @@ -90,8 +70,7 @@ DROP ROLE regress_stats_user1; DROP ROLE regress_stats_user2; SELECT pg_stat_statements_reset() IS NOT NULL AS t; - t ---- - t -(1 row) - +ERROR: function pg_stat_statements_reset() does not exist +LINE 1: SELECT pg_stat_statements_reset() IS NOT NULL AS t; + ^ +HINT: No function matches the given name and argument types. You might need to add explicit type casts. diff -U3 /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/cleanup.out /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/cleanup.out --- /tmp/cirrus-ci-build/contrib/pg_stat_statements/expected/cleanup.out 2024-09-10 10:45:56.249899000 +0000 +++ /tmp/cirrus-ci-build/build/testrun/pg_stat_statements/regress/results/cleanup.out 2024-09-10 10:49:22.465863000 +0000 @@ -1 +1,2 @@ DROP EXTENSION pg_stat_statements; +ERROR: extension "pg_stat_statements" does not exist