Re: Non-existent cs_log function - Mailing list pgsql-docs

From Bruce Momjian
Subject Re: Non-existent cs_log function
Date
Msg-id 201103111348.p2BDm5u13846@momjian.us
Whole thread Raw
In response to Non-existent cs_log function  (Thom Brown <thom@linux.com>)
Responses Re: Non-existent cs_log function  (Thom Brown <thom@linux.com>)
List pgsql-docs
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  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
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;

pgsql-docs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Building PDFs error: \pdfendlink ended up in different nesting level than \pd
Next
From: Robert Haas
Date:
Subject: Re: explaining "context" column of pg_settings