Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecWvX-0002NG-1C for pgsql-performance@arkaria.postgresql.org; Fri, 19 Jan 2018 13:41:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecWvV-00007r-PJ for pgsql-performance@arkaria.postgresql.org; Fri, 19 Jan 2018 13:41:49 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ecWvV-00007C-IJ for pgsql-performance@lists.postgresql.org; Fri, 19 Jan 2018 13:41:49 +0000 Received: from mail.thelabyrinth.net ([45.56.70.56]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ecWvS-0002xC-6m for pgsql-performance@postgresql.org; Fri, 19 Jan 2018 13:41:48 +0000 Received: from Davids-iMac.local (unknown [173.169.74.224]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dsteele) by mail.thelabyrinth.net (Postfix) with ESMTPSA id 293305465C; Fri, 19 Jan 2018 13:41:43 +0000 (UTC) Subject: Re: pgaudit and create postgis extension logs a lot inserts To: Magnus Hagander , Joe Conway Cc: Svensson Peter , "pgsql-performance@postgresql.org" References: <1CC6B04B8F153C4CBE486B1C7FD897430269E49962@WINVMSERV463.ad.smhi.se> <514a9172-df28-56ab-ee65-2c01e5cbeb6a@joeconway.com> From: David Steele Message-ID: Date: Fri, 19 Jan 2018 08:41:42 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/19/18 6:05 AM, Magnus Hagander wrote: > > > On Thu, Jan 18, 2018 at 6:54 PM, Joe Conway > wrote: > > On 01/18/2018 04:12 AM, Svensson Peter wrote: > > When I then install  postgis extension in a database it writes a huge > > amount of logs which slow down the server a lot. > > Not only table creation and functions are logged,  even  all inserts in  > > spatial_ref_sys are written to the audit-log. > > > > LOG:  AUDIT: SESSION,1,1,DDL,CREATE FUNCTION,,," > > ...... > > INSERT INTO ""spatial_ref_sys"" (""srid"",""auth_name" > > .... > > > > This behaviour make pgaudit useless in our environment due to the > > overhead in log-file write. > > How often do you intend to install PostGIS? Disable pgaudit, install > PostGIS, enable pgaudit? > > > Would it make sense for pgaudit to, at least by option, not include DDL > statements that are generated as "sub-parts" of a CREATE EXTENSION? It > should still log the CREATE EXTENSION of course, but not necessarily all > the contents of it, since that's actually defined in the extension > itself already? That's doable, but I think it could be abused if it was always on and installing extensions is generally not a daily activity. It seems in this case the best action is to disable pgaudit before installing postgis or install postgis first. Regards, -- -David david@pgmasters.net