Commit 2034086e authored by Tom Lane's avatar Tom Lane

Correct some errors in plpgsql examples, as reported by Junichi Kobayasi.

parent 0b3bca6c
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.41 2001/10/09 04:15:38 tgl Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.42 2001/10/09 04:55:11 tgl Exp $
--> -->
<chapter id="plpgsql"> <chapter id="plpgsql">
...@@ -519,8 +519,8 @@ create function cs_refresh_one_mv(integer) returns integer as ' ...@@ -519,8 +519,8 @@ create function cs_refresh_one_mv(integer) returns integer as '
-- The mv_name column of cs_materialized_views stores view -- The mv_name column of cs_materialized_views stores view
-- names. -- names.
TRUNCATE TABLE table_data.mv_name; EXECUTE ''TRUNCATE TABLE '' || quote_ident(table_data.mv_name);
INSERT INTO table_data.mv_name || '' '' || table_data.mv_query; EXECUTE ''INSERT INTO '' || quote_ident(table_data.mv_name) || '' '' || table_data.mv_query;
return 1; return 1;
end; end;
...@@ -1151,7 +1151,7 @@ END LOOP; ...@@ -1151,7 +1151,7 @@ END LOOP;
FOR i IN 1..10 LOOP FOR i IN 1..10 LOOP
-- some expressions here -- some expressions here
RAISE NOTICE 'i is %',i; RAISE NOTICE ''i is %'',i;
END LOOP; END LOOP;
FOR i IN REVERSE 1..10 LOOP FOR i IN REVERSE 1..10 LOOP
...@@ -1304,9 +1304,9 @@ BEGIN ...@@ -1304,9 +1304,9 @@ BEGIN
-- Now "mviews" has one record from cs_materialized_views -- Now "mviews" has one record from cs_materialized_views
PERFORM cs_log(''Refreshing materialized view '' || mview.mv_name || ''...''); PERFORM cs_log(''Refreshing materialized view '' || quote_ident(mviews.mv_name) || ''...'');
TRUNCATE TABLE mview.mv_name; EXECUTE ''TRUNCATE TABLE '' || quote_ident(mviews.mv_name);
INSERT INTO mview.mv_name || '' '' || mview.mv_query; EXECUTE ''INSERT INTO '' || quote_ident(mviews.mv_name) || '' '' || mviews.mv_query;
END LOOP; END LOOP;
PERFORM cs_log(''Done refreshing materialized views.''); PERFORM cs_log(''Done refreshing materialized views.'');
......
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