pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Steele <david@pgmasters.net>
To: Tatsuo Ishii <ishii@postgresql.org>
Cc: simon@2ndQuadrant.com
Cc: pgsql-hackers@postgresql.org
Cc: sawada.mshk@gmail.com
Cc: ams@2ndQuadrant.com
Cc: masao.fujii@gmail.com
Subject: Re: Auditing extension for PostgreSQL (Take 2)
Date: Wed, 15 Apr 2015 13:40:02 -0400
Message-ID: <552EA272.1040906@pgmasters.net> (raw)
In-Reply-To: <20150415.093737.74027275338109111.t-ishii@sraoss.co.jp>
References: <552D2C1A.3060002@pgmasters.net>
	<20150415.081354.1167351714960358354.t-ishii@sraoss.co.jp>
	<552DA959.2010102@pgmasters.net>
	<20150415.093737.74027275338109111.t-ishii@sraoss.co.jp>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

On 4/14/15 8:37 PM, Tatsuo Ishii wrote:
> BTW, in my understanding pg_audit allows to track a table access even
> if it's used in a view. I think this is a nice feature and it would be
> better explicitly stated in the document and the test case is better
> included in the regression test.
> 
> Here is a sample session:
> 
> CREATE TABLE test2 (id INT);
> CREATE VIEW vtest2 AS SELECT * FROM test2;
> GRANT SELECT ON TABLE public.test2 TO auditor;
> GRANT SELECT ON TABLE public.vtest2 TO auditor;
> SELECT * FROM vtest2;
> NOTICE:  AUDIT: SESSION,1,1,READ,SELECT,,,SELECT * FROM vtest2;
> NOTICE:  AUDIT: OBJECT,1,1,READ,SELECT,VIEW,public.vtest2,SELECT * FROM vtest2;
> NOTICE:  AUDIT: OBJECT,1,1,READ,SELECT,TABLE,public.test2,SELECT * FROM vtest2;

That's the idea!  In the documentation I throw around the word
"relation" pretty liberally, but you are right that some clarification
would be helpful.

I have added a few parenthetical statements to the docs that should make
them clearer.  I also took your suggestion and added a view regression test.

Both are in patch v9 which I attached to my previous email on this thread.

Thank you for taking the time to have a look.

-- 
- David Steele
david@pgmasters.net

Attachments:

  signature.asc (application/pgp-signature, 818B) download

view thread (65+ messages)  latest in thread

Message-ID: <552EA272.1040906@pgmasters.net>
Permalink:  ../552EA272.1040906@pgmasters.net/
Also on:    postgresql.org/message-id/552EA272.1040906@pgmasters.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: david@pgmasters.net, ishii@postgresql.org, simon@2ndQuadrant.com, sawada.mshk@gmail.com, ams@2ndQuadrant.com, masao.fujii@gmail.com
  Subject: Re: Auditing extension for PostgreSQL (Take 2)
  In-Reply-To: <552EA272.1040906@pgmasters.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox