summaryrefslogtreecommitdiff
path: root/contrib/pg_stat_statements/sql
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2016-11-12 05:01:48 -0800
committerAndres Freund <andres@anarazel.de>2016-11-12 05:01:48 -0800
commit9be244dbe876038676e92e34d0f9fe55914376d2 (patch)
treee6c6d664cc92d12df8fa444cd907daa7480bc4ae /contrib/pg_stat_statements/sql
parent1c1475577623019ff887825b9a804f78ec806344 (diff)
downloadpostgresql-9be244dbe876038676e92e34d0f9fe55914376d2.tar.gz
Add minimal set of regression tests for pg_stat_statements.
While the set of covered functionality is fairly small, the added tests still are useful to get some basic buildfarm testing of pg_stat_statements itself, but also to exercise the lwlock tranch code on the buildfarm. Author: Amit Kapila, slightly editorialized by me Reviewed-By: Ashutosh Sharma, Andres Freund Discussion: <CAA4eK1JOjkdXYtHxh=2aDK4VgDtN-LNGKY_YqX0N=YEvuzQVWg@mail.gmail.com>
Diffstat (limited to 'contrib/pg_stat_statements/sql')
-rw-r--r--contrib/pg_stat_statements/sql/pg_stat_statements.sql15
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/pg_stat_statements/sql/pg_stat_statements.sql b/contrib/pg_stat_statements/sql/pg_stat_statements.sql
new file mode 100644
index 0000000000..7e2b263428
--- /dev/null
+++ b/contrib/pg_stat_statements/sql/pg_stat_statements.sql
@@ -0,0 +1,15 @@
+CREATE EXTENSION pg_stat_statements;
+
+CREATE TABLE test (a int, b char(20));
+
+-- test the basic functionality of pg_stat_statements
+SELECT pg_stat_statements_reset();
+
+INSERT INTO test VALUES(generate_series(1, 10), 'aaa');
+UPDATE test SET b = 'bbb' WHERE a > 5;
+
+SELECT query, calls, rows from pg_stat_statements ORDER BY rows;
+
+DROP TABLE test;
+
+DROP EXTENSION pg_stat_statements;