transparently log a right error

From: "Jean-Yves F(dot) Barbier" <12ukwn(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: transparently log a right error
Date: 2009-11-26 15:56:21
Message-ID: 4B0EA525.8040402@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi list,

How could I transparently log an error where user miss a right,
I know how to write a RULE, but not this way:

ie:
* user don't have a direct access to tables but to procedures that
manipulates tables.

* He try to make a: SELECT * FROM table5
which normally returns: "ERROR: right refused for relation table5"

* I wanna log the user's name into a separate table, but still
having PG reporting the usual error (NOT using regular logs)

something like:
INSERT INTO security.crime(default, session_user, 'SELECT', 'table5');

Of course, if it could be generic, it would be better :)

JY
--
No one born with a mouth and a need is "innocent".
-- Greg Bear

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Shak 2009-11-26 16:06:45 Invalid redo in checkpoint record
Previous Message Tom Lane 2009-11-26 15:52:11 Re: How are blobs (oid) stored?