Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id B13571337990 for ; Fri, 11 Mar 2011 09:48:09 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 35737-03 for ; Fri, 11 Mar 2011 13:48:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from momjian.us (momjian.us [70.90.9.53]) by mail.postgresql.org (Postfix) with ESMTP id EDCA6133616B for ; Fri, 11 Mar 2011 09:48:01 -0400 (AST) Received: (from bruce@localhost) by momjian.us (8.11.6/8.11.6) id p2BDm5u13846; Fri, 11 Mar 2011 08:48:05 -0500 (EST) From: Bruce Momjian Message-Id: <201103111348.p2BDm5u13846@momjian.us> Subject: Re: Non-existent cs_log function In-Reply-To: To: Thom Brown Date: Fri, 11 Mar 2011 08:48:05 -0500 (EST) CC: pgsql-docs X-Mailer: ELM [version 2.4ME+ PL124 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="ELM1299851285-10557-6_" Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201103/67 X-Sequence-Number: 6500 --ELM1299851285-10557-6_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="US-ASCII" Thom Brown wrote: > It's been pointed out that on the pl/pgsql control structures page > (http://www.postgresql.org/docs/9.0/interactive/plpgsql-control-structures.html) > there's an example using a cs_log function, which doesn't exist. I'm > assuming this is supposed to be an example of a custom logging > function someone might have, but it might cause less confusion if > these were changed to RAISE calls, or something else that exists. > > What do you think? Done, in the attached applied patch. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + It's impossible for everything to be true. + --ELM1299851285-10557-6_ Content-Transfer-Encoding: 7bit Content-Type: text/x-diff Content-Disposition: inline; filename="/rtmp/raise.diff" diff --git a/doc/src/sgml/plpgsql.sgml b/doc/src/sgml/plpgsql.sgml index d0672bb..8da093b 100644 --- a/doc/src/sgml/plpgsql.sgml +++ b/doc/src/sgml/plpgsql.sgml @@ -2169,21 +2169,20 @@ CREATE FUNCTION cs_refresh_mviews() RETURNS integer AS $$ DECLARE mviews RECORD; 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 -- Now "mviews" has one record from cs_materialized_views - PERFORM cs_log('Refreshing materialized view ' - || quote_ident(mviews.mv_name) || ' ...'); + RAISE NOTICE 'Refreshing materialized view %s ...', quote_ident(mviews.mv_name); EXECUTE 'TRUNCATE TABLE ' || quote_ident(mviews.mv_name); EXECUTE 'INSERT INTO ' || quote_ident(mviews.mv_name) || ' ' || mviews.mv_query; END LOOP; - PERFORM cs_log('Done refreshing materialized views.'); + RAISE NOTICE 'Done refreshing materialized views.'; RETURN 1; END; $$ LANGUAGE plpgsql; --ELM1299851285-10557-6_--