selective statement logging - Mailing list pgsql-hackers

From Andrew Dunstan
Subject selective statement logging
Date
Msg-id 404F4F1A.8070502@dunslane.net
Whole thread Raw
Responses Re: selective statement logging  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-hackers
The TODO list contains this item which I said I would look at:
 Allow logging of only data definition(DDL), or DDL and modification 
statements

The trouble I see is that we currently do statement logging before we 
have examined the query string at all, in the code shown below from 
src/backend/tcop/postgres.c.

I guess I could construct one or more regexes to examine the query 
string, although that might affect performance a bit (of course, I would 
precompile the patterns).

Any other ideas on how to proceed?

cheers

andrew



List *
pg_parse_query(const char *query_string)
{   List       *raw_parsetree_list;
   if (log_statement)       ereport(LOG,               (errmsg("statement: %s", query_string)));
   if (log_parser_stats)       ResetUsage();
   raw_parsetree_list = raw_parser(query_string);
   if (log_parser_stats)       ShowUsage("PARSER STATISTICS");
   return raw_parsetree_list;
}



pgsql-hackers by date:

Previous
From: Andreas Pflug
Date:
Subject: Re: PITR Functional Design v2 for 7.5
Next
From: "scott.marlowe"
Date:
Subject: Re: About hierarchical_query of Oracle