Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1YtLnM-0002rE-Fk for pgsql-committers@arkaria.postgresql.org; Fri, 15 May 2015 20:01:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1YtLnL-0003NS-Ty for pgsql-committers@arkaria.postgresql.org; Fri, 15 May 2015 20:01:19 +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 1YtLnL-0003MD-2Q for pgsql-committers@postgresql.org; Fri, 15 May 2015 20:01:19 +0000 Received: from mail-qk0-f175.google.com ([209.85.220.175]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1YtLnH-00005t-K9 for pgsql-committers@postgresql.org; Fri, 15 May 2015 20:01:18 +0000 Received: by qkai132 with SMTP id i132so11205270qka.2 for ; Fri, 15 May 2015 13:01:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-type:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=zZSreT5qUuxQmCnaDMSumYKqy2tng+e3kBauz2MREkU=; b=lkYacyZGeM0QM/qaCUpGtdq6fBw7Ilkqjk6NxUgsLiBz3QKrK20ONp7g15CqngE46O MyBQz41cX/xKy4xpj/IkMX/dsPFTq/42YP/0r0P5XF1om8EJsxlLQs04ml1sAbR+lSrN 1ujgnm2GNwFMXPjeUjB3r4jW/If4a8tWeaMd69RENWz41wDlkzq/lqm8NJNsp3S+khDh cYRYb5DD6mHPAM3RCFHKPKBAIt22bRs9gJMpgzeg5ASjOtYmyw1jbGailQQdKi45eWs0 FSPBlwjgyTeULnpXn+ACNgs6Hi1sYPQ1YX1DVmK9cuuDsGcoe6QrFgHzq1k1trxVvAf7 6LuQ== X-Gm-Message-State: ALoCoQnqAn22N2bADfaaMMv1WvK0oCkMIfVRQ0OLRaqOFS5NJKHW2CNQQU1ve5jsN22dUQ5TDhPf X-Received: by 10.55.25.42 with SMTP id k42mr23131472qkh.66.1431720074134; Fri, 15 May 2015 13:01:14 -0700 (PDT) Received: from alvin.alvh.no-ip.org ([186.37.20.197]) by mx.google.com with ESMTPSA id d69sm1703784qhc.3.2015.05.15.13.01.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 May 2015 13:01:13 -0700 (PDT) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id E33192112; Fri, 15 May 2015 17:01:52 -0300 (CLT) Date: Fri, 15 May 2015 17:01:52 -0300 From: Alvaro Herrera To: Stephen Frost Cc: Fujii Masao , pgsql-committers Subject: Re: pgsql: Add pg_audit, an auditing extension Message-ID: <20150515200152.GG2523@alvh.no-ip.org> References: <20150515194421.GX30322@tamriel.snowman.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20150515194421.GX30322@tamriel.snowman.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -2.8 (--) 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 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. > > > > =# 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. Can you explain what's going on here? It seems a bit odd to me. > > The categories of some SQL commands are different between log_statement 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-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? Thiking a bit about this, it seems that REINDEX and CLUSTER are not really DDL. They are more "maintenance commands"; they don't define anything that wasn't defined before. -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers