Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 7D87B9F9271 for ; Tue, 6 Nov 2007 07:24:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 92784-01 for ; Tue, 6 Nov 2007 07:24:49 -0400 (AST) Received: from fitch3.uni2.net (fitch3.uni2.net [130.227.52.123]) by postgresql.org (Postfix) with ESMTP id D52959F926E for ; Tue, 6 Nov 2007 07:24:48 -0400 (AST) Received: from [172.16.244.96] (gateway.tele2.dk [129.142.17.131]) by fitch3.uni2.net (Postfix) with ESMTP id 3FCD9EAC224 for ; Tue, 6 Nov 2007 12:24:46 +0100 (CET) Message-ID: <47304EFE.2090808@neoconsult.dk> Date: Tue, 06 Nov 2007 12:24:46 +0100 From: =?ISO-8859-1?Q?D=E1vi=F0_Klein_Sundsskar=F0?= User-Agent: Thunderbird 2.0.0.6 (X11/20070728) MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Log statements by username Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 200711/55 X-Sequence-Number: 27298 Hi, We have a database that is accessible to quite a few users. (Using their own account name of course) Our goal is to be able to log the users UPDATE statements, so that we can track down changes that were not done by our application software. Altering the log_statement parameter is not an option, since this would generate enormous amounts of statements. I'm interested in certain users only. (or in fact all but one user) One approach i have tried is to create a RULE that filters queries from the application software user out. It then updates a log table for every update, but i am unable to get a hold of the actual query that is executing. Any ideas? Regards, David