Commit 35a1964e authored by Bruce Momjian's avatar Bruce Momjian

In plpsql docs, use RAISE rather than undefined log function.

parent cbd28114
...@@ -2169,21 +2169,20 @@ CREATE FUNCTION cs_refresh_mviews() RETURNS integer AS $$ ...@@ -2169,21 +2169,20 @@ CREATE FUNCTION cs_refresh_mviews() RETURNS integer AS $$
DECLARE DECLARE
mviews RECORD; mviews RECORD;
BEGIN BEGIN
PERFORM cs_log('Refreshing materialized views...'); RAISE NOTICE 'Refreshing materialized views...';
FOR mviews IN SELECT * FROM cs_materialized_views ORDER BY sort_key LOOP FOR mviews IN SELECT * FROM cs_materialized_views ORDER BY sort_key LOOP
-- Now "mviews" has one record from cs_materialized_views -- Now "mviews" has one record from cs_materialized_views
PERFORM cs_log('Refreshing materialized view ' RAISE NOTICE 'Refreshing materialized view %s ...', quote_ident(mviews.mv_name);
|| quote_ident(mviews.mv_name) || ' ...');
EXECUTE 'TRUNCATE TABLE ' || quote_ident(mviews.mv_name); EXECUTE 'TRUNCATE TABLE ' || quote_ident(mviews.mv_name);
EXECUTE 'INSERT INTO ' EXECUTE 'INSERT INTO '
|| quote_ident(mviews.mv_name) || ' ' || quote_ident(mviews.mv_name) || ' '
|| mviews.mv_query; || mviews.mv_query;
END LOOP; END LOOP;
PERFORM cs_log('Done refreshing materialized views.'); RAISE NOTICE 'Done refreshing materialized views.';
RETURN 1; RETURN 1;
END; END;
$$ LANGUAGE plpgsql; $$ LANGUAGE plpgsql;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment