Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 9C8C9B5DC2B for ; Tue, 13 Sep 2011 04:24:55 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 11248-09 for ; Tue, 13 Sep 2011 07:24:49 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sd-17937.dedibox.fr (sd-17937.dedibox.fr [88.191.100.74]) by mail.postgresql.org (Postfix) with ESMTP id AA3D5B5DC1F for ; Tue, 13 Sep 2011 04:24:48 -0300 (ADT) Received: from [192.168.42.162] (LCaen-151-93-7-26.w80-13.abo.wanadoo.fr [80.13.230.26]) by sd-17937.dedibox.fr (Postfix) with ESMTPA id EDF383B8F5; Tue, 13 Sep 2011 09:24:47 +0200 (CEST) Subject: Re: access log for 1 table From: Guillaume Lelarge To: Peter Koczan Cc: pgsql-admin@postgresql.org Date: Tue, 13 Sep 2011 09:24:47 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Content-Transfer-Encoding: 7bit Message-ID: <1315898688.2188.7.camel@localhost.localdomain> Mime-Version: 1.0 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201109/76 X-Sequence-Number: 38313 On Mon, 2011-09-12 at 13:42 -0500, Peter Koczan wrote: > Is there any way to set an access log for a specific table? > > What I'd like to do is have a record of all access for one table. It > would be nice to do this by raising a notice and having it show up in > syslog. I could use triggers, but I would need to log for SELECT > queries as well. Rules look like like they are not the best way to go > about this, either. > Rules are probably not a great way to do this, but actually it's your only option if you want to trap SELECT. -- Guillaume http://blog.guillaume.lelarge.info http://www.dalibo.com