Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gOopz-0006lu-Ki for pgsql-admin@arkaria.postgresql.org; Mon, 19 Nov 2018 19:03:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gOopx-0003t5-Ck for pgsql-admin@arkaria.postgresql.org; Mon, 19 Nov 2018 19:03:57 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gOopx-0003sy-5H for pgsql-admin@lists.postgresql.org; Mon, 19 Nov 2018 19:03:57 +0000 Received: from hermes.gatewaynet.com ([193.92.121.98]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gOopu-0002V0-N9 for pgsql-admin@lists.postgresql.org; Mon, 19 Nov 2018 19:03:56 +0000 Received: from hercules.internal.net (hercules.internal.net [10.9.200.8]) by hermes.gatewaynet.com (8.14.3/8.14.3/Debian-9.4) with ESMTP id wAJJ3qDJ018111 for ; Mon, 19 Nov 2018 21:03:52 +0200 Received: from [10.9.251.8] (dcmchgw.internal.net [10.9.0.1]) by hercules.internal.net (Postfix) with ESMTPS id D5C581350AE4 for ; Mon, 19 Nov 2018 21:03:51 +0200 (EET) Subject: Re: logging aql queries only one table or tables of one scheme To: pgsql-admin@lists.postgresql.org References: From: Achilleas Mantzios Message-ID: <45b317b6-6b12-0a64-329d-9080ff1a9be3@matrix.gatewaynet.com> Date: Mon, 19 Nov 2018 21:03:49 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Virus-Scanned: clamav-milter 0.98.7 at hermes X-Virus-Status: Clean X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on hermes.gatewaynet.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 19/11/18 6:13 μ.μ., David G. Johnston wrote: > On Mon, Nov 19, 2018 at 2:38 AM Häfliger Guido > wrote: >> Is it possible to enable query statement logging only for one table (or one scheme)? If I set log_min_duration_statement = 0 everything is logged, the log-files becomes huge. > No, that particular setting (like most) doesn't operate at a > sub-session level. And since it is super-user only changing it for > individual queries is not recommended - though you could create a > security definer function to make it doable (never tried it myself). pgaudit does the trick, but it takes some reading to get what you need. > > David J. >