Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YtLX1-00020p-Gc for pgsql-committers@arkaria.postgresql.org; Fri, 15 May 2015 19:44:27 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YtLX0-0004Gk-UW for pgsql-committers@arkaria.postgresql.org; Fri, 15 May 2015 19:44:26 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YtLWz-0004GZ-Tu for pgsql-committers@postgresql.org; Fri, 15 May 2015 19:44:25 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1YtLWw-00088l-Ls for pgsql-committers@postgresql.org; Fri, 15 May 2015 19:44:25 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id B1B935F7A5; Fri, 15 May 2015 15:44:21 -0400 (EDT) Date: Fri, 15 May 2015 15:44:21 -0400 From: Stephen Frost To: Fujii Masao Cc: pgsql-committers Subject: Re: pgsql: Add pg_audit, an auditing extension Message-ID: <20150515194421.GX30322@tamriel.snowman.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="kZpwUJ8qKUB6aHZT" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.13.0-46-generic (x86_64) X-Uptime: 15:36:42 up 57 days, 1:25, 10 users, load average: 0.13, 0.17, 0.10 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org --kZpwUJ8qKUB6aHZT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Fujii, * Fujii Masao (masao.fujii@gmail.com) wrote: > pg_audit uses 1.0.0 as its version number. But, is the third digit really > required? Why? We usually uses the version number with two digits in > contrib modules. I have to admit, I didn't look closely at how we handled versions in contrib modules and that has been the same since the patch was first posted, as I recall. No problem changing it to 1.0 and I'll take care of that soon. > CREATE EXTENSION pg_audit failed with the following error message > when shared_preload_libraries and pg_audit.log are set to pg_audit and > ddl, respectively. >=20 > =3D# create extension pg_audit ; > ERROR: pg_event_trigger_ddl_commands() can only be called in an event > trigger function > CONTEXT: SQL statement "SELECT UPPER(object_type), object_identity > FROM pg_event_trigger_ddl_commands()" Interesting. I'm very curious about this error and if it impacts other extensions which use event triggers. I'll look into it. > In Makefile, PGFILEDESC should be added. >=20 > +# pg_audit/Makefile >=20 > should be "# contrib/pg_audit/Makefile" for the consistency. Good points, will address. > The categories of some SQL commands are different between log_statement a= nd > pg_audit. For example, REINDEX is treated as DDL in pg_audit, but not in > log_statement. That's confusing. We should use the same "category-mapping" > rule as much as possible. David, Simon and I have all considered this at different times and my recollection is that we all felt that it made sense as DDL because CLUSTER is DDL (which is actually noted in the comments). However, you bring up a good point that classifying it as DDL makes it different from what the core system does and it'd probably be good to be consistent. The question here really is- is that the right classification for REINDEX to have in core? If so, shouldn't CLUSTER have the same? Probably a discussion to have on -hackers rather than here. I'll go ahead and change it to match what core does. Then, if core changes to make it DDL, pg_audit will automatically pick that up and also treat it as DDL. Thanks! Stephen --kZpwUJ8qKUB6aHZT Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJVVkyVAAoJEO1sijiDR2RVEncP/0HQ2AR4FTIlpVVcAFH7Idkr sHpAXxFxvaGWblc7wSMvkQkKlKaIA1JSv1I7H0Oj3fRO0kSVtoySSRiQsfTSysGf kbPCOPZVeSfNuLWCa/G0mKQgYAmt7BvIIAGwfvbViRp0CDVSt+AUBGm6w4u0ekd6 ZooRgciaIHGvEF+NSuvvDBpIYOCoRFL9N9YcgxFlIWISsy8p1DU783QBV8/v1lal zUQIFuhj7ZWi7K/kmYF7nDww70W+9V5mLkn9DEvVIzfJAzDG9HuksWus40fI5nzb fFAOF1+3eUqBkU6gCBWm94QyWwSihOHtfM1+Lhj68IZNV07lku8MLiIOM879vqmn Ol+9xwg3Bx02VlOq7igmmR4oZfIZqDeg0+iklGqa7YjfzsdOgZPlv9A3H+U2lo+P Yi3Rr9Z2PZv9KiicycVWyB6kQaHCDk8B2yixVIBYG8wdVgh8kksxGPt1bKuv1Gc9 j49EbgdCGom88dqIHGE/j4LcFZ0cAEYP4NESwgr0XhMp8475esdXp4h9mTwJ+yad H8f2lezn6N/RGXt2wKpEu9rYSK4q1lDL+VjCJA0a3rwEwyGbQS0vdVCuLL4crr7+ Me6LStzpebGdxH5Y19sh9a4kcx/oWwVpPL3QcI4Dj+ltuX77awfRevzmhDA7gvz9 T2WtbLIRQvZPOnLh+UQS =R9/j -----END PGP SIGNATURE----- --kZpwUJ8qKUB6aHZT--