2016-01-21 00:10:12 +08:00
|
|
|
-- Mockup for CDB_Overviews
|
2016-01-22 01:39:31 +08:00
|
|
|
CREATE OR REPLACE FUNCTION CDB_Overviews(table_name regclass)
|
|
|
|
RETURNS TABLE(z integer, overview_table regclass)
|
2016-01-21 00:10:12 +08:00
|
|
|
AS $$
|
|
|
|
BEGIN
|
2016-01-22 01:39:31 +08:00
|
|
|
IF table_name::text = 'test_table_overviews' THEN
|
2016-01-21 00:10:12 +08:00
|
|
|
RETURN QUERY
|
2016-01-22 01:39:31 +08:00
|
|
|
SELECT 1 AS z, 'test_table_overviews_ov1'::regclass AS overviw_table
|
2016-01-21 00:10:12 +08:00
|
|
|
UNION ALL
|
2016-01-22 01:39:31 +08:00
|
|
|
SELECT 2 AS z, 'test_table_overviews_ov2'::regclass AS overviw_table;
|
2016-01-21 00:10:12 +08:00
|
|
|
ELSE
|
|
|
|
RETURN;
|
|
|
|
END IF;
|
|
|
|
END
|
|
|
|
$$ LANGUAGE PLPGSQL;
|