]> granicus.if.org Git - postgresql/commitdiff
Add regression test for MV join to view.
authorKevin Grittner <kgrittn@postgresql.org>
Thu, 14 Mar 2013 18:34:51 +0000 (13:34 -0500)
committerKevin Grittner <kgrittn@postgresql.org>
Thu, 14 Mar 2013 18:34:51 +0000 (13:34 -0500)
This would have caught a bug in the initial patch, and seems like
a good thing to test going forward.

Per bug report by Erik Rijkers and fix by Tom Lane

src/test/regress/expected/matview.out
src/test/regress/sql/matview.sql

index 1077651b8e1e44ce21c57ef4a2f462fb504a61cf..f03b9196b02ac1e0f497d238dc8bb3f84b8d1214 100644 (file)
@@ -327,6 +327,15 @@ SELECT * FROM tum;
  x    |      5
 (3 rows)
 
+-- test join of mv and view
+SELECT type, m.totamt AS mtot, v.totamt AS vtot FROM tm m LEFT JOIN tv v USING (type);
+ type | mtot | vtot 
+------+------+------
+ y    |   12 |   12
+ z    |   24 |   24
+ x    |    5 |    5
+(3 rows)
+
 -- test diemv when the mv does exist
 DROP MATERIALIZED VIEW IF EXISTS tum;
 -- make sure that dependencies are reported properly when they block the drop
index e1c0e1583d63acc7a3021c569e7a0372f29fa0c6..a01d266ee5605253510a04befeb1fa8bd8ca6e3c 100644 (file)
@@ -103,6 +103,9 @@ REFRESH MATERIALIZED VIEW tum WITH DATA;
 SELECT pg_relation_is_scannable('tum'::regclass);
 SELECT * FROM tum;
 
+-- test join of mv and view
+SELECT type, m.totamt AS mtot, v.totamt AS vtot FROM tm m LEFT JOIN tv v USING (type);
+
 -- test diemv when the mv does exist
 DROP MATERIALIZED VIEW IF EXISTS tum;