selective statement logging

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Postgresql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: selective statement logging
Date: 2004-03-10 17:23:38
Message-ID: 404F4F1A.8070502@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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;
}

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Pflug 2004-03-10 17:33:25 Re: PITR Functional Design v2 for 7.5
Previous Message Josh Berkus 2004-03-10 17:21:54 Re: [DEFAULT] Daily digest v1.4318 (23 messages)