mirror of
https://github.com/postgres/postgres.git
synced 2025-07-31 22:04:40 +03:00
Add regression test for MV join to view.
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
This commit is contained in:
@ -327,6 +327,15 @@ SELECT * FROM tum;
|
|||||||
x | 5
|
x | 5
|
||||||
(3 rows)
|
(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
|
-- test diemv when the mv does exist
|
||||||
DROP MATERIALIZED VIEW IF EXISTS tum;
|
DROP MATERIALIZED VIEW IF EXISTS tum;
|
||||||
-- make sure that dependencies are reported properly when they block the drop
|
-- make sure that dependencies are reported properly when they block the drop
|
||||||
|
@ -103,6 +103,9 @@ REFRESH MATERIALIZED VIEW tum WITH DATA;
|
|||||||
SELECT pg_relation_is_scannable('tum'::regclass);
|
SELECT pg_relation_is_scannable('tum'::regclass);
|
||||||
SELECT * FROM tum;
|
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
|
-- test diemv when the mv does exist
|
||||||
DROP MATERIALIZED VIEW IF EXISTS tum;
|
DROP MATERIALIZED VIEW IF EXISTS tum;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user