mirror of
https://github.com/percona/pg_stat_monitor.git
synced 2026-02-04 05:56:21 +00:00
As part of this PR, also updated regression test cases that are related to following JIRA issues as well. PG-354 pg_stat_monitor: Remove pg_stat_monitor_settings view Now we not using pg_stat_monitor_settings view, due to this change majority of TAP testcase requried output changes. PG-558: Create test case to verify the function names and count in PGSM. Added additional output file for SQL test case. PG-554: Remove redundant expected output files from regression. Removed unnecessary output files in TAP testcases where these were not needed.
80 lines
1.9 KiB
SQL
80 lines
1.9 KiB
SQL
CREATE EXTENSION pg_stat_monitor;
|
|
SELECT pg_stat_monitor_reset();
|
|
CREATE TABLE foo1(a int);
|
|
CREATE TABLE foo2(b int);
|
|
CREATE TABLE foo3(c int);
|
|
CREATE TABLE foo4(d int);
|
|
|
|
-- test the simple table names
|
|
SELECT pg_stat_monitor_reset();
|
|
SELECT * FROM foo1;
|
|
SELECT * FROM foo1, foo2;
|
|
SELECT * FROM foo1, foo2, foo3;
|
|
SELECT * FROM foo1, foo2, foo3, foo4;
|
|
SELECT query, relations from pg_stat_monitor ORDER BY query collate "C";
|
|
SELECT pg_stat_monitor_reset();
|
|
|
|
|
|
-- test the schema qualified table
|
|
CREATE SCHEMA sch1;
|
|
CREATE SCHEMA sch2;
|
|
CREATE SCHEMA sch3;
|
|
CREATE SCHEMA sch4;
|
|
|
|
CREATE TABLE sch1.foo1(a int);
|
|
CREATE TABLE sch2.foo2(b int);
|
|
CREATE TABLE sch3.foo3(c int);
|
|
CREATE TABLE sch4.foo4(d int);
|
|
|
|
SELECT pg_stat_monitor_reset();
|
|
SELECT * FROM sch1.foo1;
|
|
SELECT * FROM sch1.foo1, sch2.foo2;
|
|
SELECT * FROM sch1.foo1, sch2.foo2, sch3.foo3;
|
|
SELECT * FROM sch1.foo1, sch2.foo2, sch3.foo3, sch4.foo4;
|
|
SELECT query, relations from pg_stat_monitor ORDER BY query collate "C";
|
|
SELECT pg_stat_monitor_reset();
|
|
|
|
SELECT pg_stat_monitor_reset();
|
|
SELECT * FROM sch1.foo1, foo1;
|
|
SELECT * FROM sch1.foo1, sch2.foo2, foo1, foo2;
|
|
SELECT query, relations from pg_stat_monitor ORDER BY query;
|
|
SELECT pg_stat_monitor_reset();
|
|
|
|
-- test the view
|
|
CREATE VIEW v1 AS SELECT * from foo1;
|
|
CREATE VIEW v2 AS SELECT * from foo1,foo2;
|
|
CREATE VIEW v3 AS SELECT * from foo1,foo2,foo3;
|
|
CREATE VIEW v4 AS SELECT * from foo1,foo2,foo3,foo4;
|
|
|
|
SELECT pg_stat_monitor_reset();
|
|
SELECT * FROM v1;
|
|
SELECT * FROM v1,v2;
|
|
SELECT * FROM v1,v2,v3;
|
|
SELECT * FROM v1,v2,v3,v4;
|
|
SELECT query, relations from pg_stat_monitor ORDER BY query collate "C";
|
|
SELECT pg_stat_monitor_reset();
|
|
|
|
|
|
DROP VIEW v1;
|
|
DROP VIEW v2;
|
|
DROP VIEW v3;
|
|
DROP VIEW v4;
|
|
|
|
DROP TABLE foo1;
|
|
DROP TABLE foo2;
|
|
DROP TABLE foo3;
|
|
DROP TABLE foo4;
|
|
|
|
DROP TABLE sch1.foo1;
|
|
DROP TABLE sch2.foo2;
|
|
DROP TABLE sch3.foo3;
|
|
DROP TABLE sch4.foo4;
|
|
|
|
DROP SCHEMA sch1;
|
|
DROP SCHEMA sch2;
|
|
DROP SCHEMA sch3;
|
|
DROP SCHEMA sch4;
|
|
|
|
|
|
DROP EXTENSION pg_stat_monitor;
|