Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YtMoy-0005c3-Ts for pgsql-committers@arkaria.postgresql.org; Fri, 15 May 2015 21:07:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YtMoy-0006i0-5s for pgsql-committers@arkaria.postgresql.org; Fri, 15 May 2015 21:07:04 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YtMox-0006hu-CV for pgsql-committers@postgresql.org; Fri, 15 May 2015 21:07:03 +0000 Received: from linode.thelabyrinth.net ([198.58.117.137] helo=mail.thelabyrinth.net) by makus.postgresql.org with esmtps (TLS1.1:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YtMou-0001bA-TL for pgsql-committers@postgresql.org; Fri, 15 May 2015 21:07:02 +0000 Received: from theseus.local (wsip-174-78-148-105.dc.dc.cox.net [174.78.148.105]) (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 115EA12F98; Fri, 15 May 2015 21:06:59 +0000 (UTC) Message-ID: <55565FF4.9040506@pgmasters.net> Date: Fri, 15 May 2015 17:07:00 -0400 From: David Steele User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Stephen Frost , Fujii Masao CC: pgsql-committers Subject: Re: pgsql: Add pg_audit, an auditing extension References: <20150515194421.GX30322@tamriel.snowman.net> In-Reply-To: <20150515194421.GX30322@tamriel.snowman.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="W6wfjM5GHDcjghV22VrBGOPlWKeFrJtlM" 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 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --W6wfjM5GHDcjghV22VrBGOPlWKeFrJtlM Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 5/15/15 3:44 PM, Stephen Frost wrote: > * Fujii Masao (masao.fujii@gmail.com) wrote: >> 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. >> >> =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. I'm looking into this. There's definitely something strange going on here, but not sure it's in pg_audit. >> The categories of some SQL commands are different between log_statemen= t and >> 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-mapp= ing" >> 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 fro= m > 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. I admit I was influenced by this comment in core: case T_ReindexStmt: lev =3D LOGSTMT_ALL; /* should this be DDL? */ break; and the fact that CLUSTER is DDL. I'm not married to REINDEX as DDL, though. I'm happy to make it consistent with core. If it changes in core, it would also change in pg_audit. --=20 - David Steele david@pgmasters.net --W6wfjM5GHDcjghV22VrBGOPlWKeFrJtlM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJVVl/0AAoJEIA2uIJQ5SFAfL8P+QHaggrrCKmNvw4lodNhoe/W JzIMEZ8ed1VNP499gXNDCBiz+UyixoJ5vcdoUWROr8gj4a/773MVpJeYTl2qB8do SfXHSQtcob45AmBZHylTuLIv9OEzeGxbyLRTifImmF1M16muJoDMtoKSJ+wnKJ21 TO88qA2LJrBftG2bFPusQ/i0vmV29BsS46hjs7KcW/vcBdGBwboC9psdPrtrkFlL ePdAmOQRmoKkk//8dgiVLWIdu3HVfrhEUXmtXa8ufaDBqzCF4EJYrhvwG7mqq2EC o9jR9LX6ec3R5WCy51xBoVLFF00Exv0kYTfK962Dwv593PWKPhPOg8Zxw6vKymqt KirgfU9xelaPnUmqXzvrEw/RerULY0zTBDprrCtFHEp5nDz5dIJb4qUIrYP6ivbi eiqScuELHY5GKMrgkn2iM1tSbVoropO71AxzS1X5pXXsXlXEtHtFWzXwwN2D1By7 iJFLYHug6OZoxJMFTzwp9FJgfVhvI7UkWJ5jOTEnwK7USXCXt82nhsy8vG8qGLXO TWCGPeikmNANeTdf2tHSCgVSwx3Iq5PPX2cZC2a41UTWogORQKCQzK7hpDdhl5M1 iVEi5pm3DF2fQxpl7bPln66d4aUsQVfjxekmDVyd33PMdUCknoAzaWNpDAUFnfE5 uJKi3xKPTMEc168ezNMy =BDoU -----END PGP SIGNATURE----- --W6wfjM5GHDcjghV22VrBGOPlWKeFrJtlM--