Subject: [PATCH] log_statement docs

From: gabrielle <[email-masked]>
Date: Wed, 24 Feb 2010 18:42:19 -0800

Patch amends description of log_statement to include definition of "all" option.

gabrielle
From b48f3187ade475570df1eeca1721cf58204ee842 Mon Sep 17 00:00:00 2001
From: Gabrielle Roth <[email-masked]>
Date: Wed, 24 Feb 2010 18:34:03 -0800
Subject: [PATCH] Amend description of log_statement

- add definition of "all" option.
---
 doc/src/sgml/config.sgml |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
index df1d5f1..840b239 100644
--- a/doc/src/sgml/config.sgml
+++ b/doc/src/sgml/config.sgml
@@ -3373,7 +3373,9 @@ FROM pg_stat_activity;
         <literal>ddl</> statements, plus data-modifying statements
         such as <command>INSERT</>,
         <command>UPDATE</>, <command>DELETE</>, <command>TRUNCATE</>,
-        and <command>COPY FROM</>.
+        and <command>COPY FROM</>. 
+        <literal>all</> includes <literal>ddl</> and <literal>mod</>, 
+        plus <command>SELECT</>. 
         <command>PREPARE</>, <command>EXECUTE</>, and
         <command>EXPLAIN ANALYZE</> statements are also logged if their
         contained command is of an appropriate type.  For clients using
-- 
1.7.0

---

From: Tom Lane <[email-masked]>
Date: Wed, 24 Feb 2010 22:14:57 -0500

> Patch amends description of log_statement to include definition of "all" option.

Shouldn't it just say "all means all", if we think that needs to be
explained?

			regards, tom lane

---

From: gabrielle <[email-masked]>
Date: Thu, 25 Feb 2010 09:21:46 -0800

> Shouldn't it just say "all means all", if we think that needs to be

I think it should say something about the "all" option.  I read &
re-read that section trying to figure out what the difference between
"mod" and "all" was, and finally asked on the irc channel.  As it
stands, it essentially says "there are three options to this command,
but we're only going to tell you about two of them." :)

Thanks!
gabrielle

---

From: Bruce Momjian <[email-masked]>
Date: Thu, 25 Feb 2010 13:47:03 -0500 (EST)

> but we're only going to tell you about two of them." :)

Well, if you take a look at utility.c:GetCommandLogLevel() you will see
that ALL includes a lot more commands than just SELECT.

-- 
  Bruce Momjian  <[email-masked]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com
  PG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do
  + If your life is a hard drive, Christ can be your backup. +

---

From: Tom Lane <[email-masked]>
Date: Thu, 25 Feb 2010 14:07:57 -0500

> that ALL includes a lot more commands than just SELECT.

Yeah.  My objection was not to documenting ALL, it was to documenting it
with exactly that sentence, which seems both needlessly complicated and
subject to errors of omission.

			regards, tom lane

---

From: Bruce Momjian <[email-masked]>
Date: Thu, 25 Feb 2010 14:20:41 -0500 (EST)

> subject to errors of omission.

I have applied the following patch with adds "off" and "all statements"
identifiers.  This is probaby the right level of detail for this.

-- 
  Bruce Momjian  <[email-masked]>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com
  PG East:  http://www.enterprisedb.com/community/nav-pg-east-2010.do
  + If your life is a hard drive, Christ can be your backup. +
Index: doc/src/sgml/config.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/config.sgml,v
retrieving revision 1.253
diff -c -c -r1.253 config.sgml
*** doc/src/sgml/config.sgml	25 Feb 2010 13:26:15 -0000	1.253
--- doc/src/sgml/config.sgml	25 Feb 2010 19:19:14 -0000
***************
*** 3392,3399 ****
        <listitem>
         <para>
          Controls which SQL statements are logged. Valid values are
!         <literal>none</>, <literal>ddl</>, <literal>mod</>, and
!         <literal>all</>. <literal>ddl</> logs all data definition
          statements, such as <command>CREATE</>, <command>ALTER</>, and
          <command>DROP</> statements. <literal>mod</> logs all
          <literal>ddl</> statements, plus data-modifying statements
--- 3392,3399 ----
        <listitem>
         <para>
          Controls which SQL statements are logged. Valid values are
!         <literal>none</> (off), <literal>ddl</>, <literal>mod</>, and
!         <literal>all</> (all statements). <literal>ddl</> logs all data definition
          statements, such as <command>CREATE</>, <command>ALTER</>, and
          <command>DROP</> statements. <literal>mod</> logs all
          <literal>ddl</> statements, plus data-modifying statements

---

From: gabrielle <[email-masked]>
Date: Thu, 25 Feb 2010 11:27:37 -0800

> identifiers.  This is probaby the right level of detail for this.

Thank you!

gabrielle