X-Original-To: pgsql-patches-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 0095F52875 for ; Wed, 1 Jun 2005 20:28:06 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63129-10 for ; Wed, 1 Jun 2005 23:27:59 +0000 (GMT) Received: from candle.pha.pa.us (candle.pha.pa.us [64.139.89.126]) by svr1.postgresql.org (Postfix) with ESMTP id 700E252800 for ; Wed, 1 Jun 2005 20:27:57 -0300 (ADT) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id j51NS1n17362; Wed, 1 Jun 2005 19:28:01 -0400 (EDT) From: Bruce Momjian Message-Id: <200506012328.j51NS1n17362@candle.pha.pa.us> Subject: Re: [ADMIN] Config option log_statement In-Reply-To: <20050514230045.6150.qmail@web51009.mail.yahoo.com> To: S Murthy Kambhampaty Date: Wed, 1 Jun 2005 19:28:01 -0400 (EDT) Cc: PostgreSQL-patches X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Type: multipart/mixed; boundary=ELM1117668481-6394-0_ Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.009 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/13 X-Sequence-Number: 15745 --ELM1117668481-6394-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII Fix applied. It will appear in 8.0.X. Patch attached. --------------------------------------------------------------------------- S Murthy Kambhampaty wrote: > In postgresql 8.0, "create table <> as ..." statements > appear not to logged unless log_statement = 'all' in > postgresql.conf. We are trying to reduce noise in the > logs from pgAdminIII and phpPgAdmin, but we use a lot > of 'create table <> as ...' queries that need to be > logged, and their duration tracked. Is there a > combination of settings that will do the trick? Can > postgresql be upgraded to log "create table <> as ..." > statements with log_statment = 'ddl' and/or > log_statment = 'mod'? > > Thanks, > Murthy > > > > __________________________________ > Yahoo! Mail Mobile > Take Yahoo! Mail with you! Check email on your mobile phone. > http://mobile.yahoo.com/learn/mail > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073 --ELM1117668481-6394-0_ Content-Transfer-Encoding: 7bit Content-Type: text/plain Content-Disposition: inline; filename="/bjm/diff" Index: src/backend/tcop/postgres.c =================================================================== RCS file: /cvsroot/pgsql/src/backend/tcop/postgres.c,v retrieving revision 1.440 diff -c -c -r1.440 postgres.c *** src/backend/tcop/postgres.c 31 Dec 2004 22:01:16 -0000 1.440 --- src/backend/tcop/postgres.c 1 Jun 2005 23:24:09 -0000 *************** *** 495,501 **** if (IsA(parsetree, PrepareStmt)) parsetree = (Node *) (((PrepareStmt *) parsetree)->query); ! if (IsA(parsetree, SelectStmt)) continue; /* optimization for frequent command */ if (log_statement == LOGSTMT_MOD && --- 495,502 ---- if (IsA(parsetree, PrepareStmt)) parsetree = (Node *) (((PrepareStmt *) parsetree)->query); ! if (IsA(parsetree, SelectStmt) && ! ((SelectStmt *) parsetree)->into == NULL) continue; /* optimization for frequent command */ if (log_statement == LOGSTMT_MOD && *************** *** 513,518 **** --- 514,520 ---- } commandTag = CreateCommandTag(parsetree); if (strncmp(commandTag, "CREATE ", strlen("CREATE ")) == 0 || + IsA(parsetree, SelectStmt) || /* SELECT INTO, CREATE AS */ strncmp(commandTag, "ALTER ", strlen("ALTER ")) == 0 || strncmp(commandTag, "DROP ", strlen("DROP ")) == 0 || IsA(parsetree, GrantStmt) || /* GRANT or REVOKE */ --ELM1117668481-6394-0_--