This is best done by using a trigger on the table.
http://www.varlena.com/GeneralBits/38.php shows how
to do it with both a trigger and with a rule.
--elein
[EMAIL PROTECTED]
On Fri, May 05, 2006 at 04:48:28PM -0400, Sean Hamilton wrote:
> I have to log each time a user selects data from a table
On 5/5/06, Sean Hamilton <[EMAIL PROTECTED]> wrote:
I have to log each time a user selects data from a table by inserting
record in another table.
For example
I have table xzy
user test selects id, name from table xyz.
I want to insert into table xyz_log
user, action, fields, timestamp
test, sele
quot;
To: ,
Subject: audit table containing Select statements submitted
Date: Thu, 4 May 2006 12:45:59 -0500
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Sean Hamilton
Sent: Friday, May 05, 2006 3:48 PM
To: pgsql-general@postgresql.org
Subject: [GENERAL
I have to log each time a user selects data from a table by inserting
record in another table.
For example
I have table xzy
user test selects id, name from table xyz.
I want to insert into table xyz_log
user, action, fields, timestamp
test, select, id name, 12/1/05 02:00:21
How can i do this u
On Behalf Of Mariusz Czu³ada
Sent: Monday, January 17, 2005 7:29 AM
To: Postgres General
Subject: [GENERAL] Rules on select
Hi,
I tried to create rule on a view. It should contain a WHERE clause.
Unfortunately it does not work:
a_4m=# CREATE RULE sharp_p1_rule AS ON SELECT TO sharp
a_4m
Hi,
I tried to create rule on a view. It should contain a WHERE clause.
Unfortunately it does not work:
a_4m=# CREATE RULE sharp_p1_rule AS ON SELECT TO sharp
a_4m-# WHERE part_key = 1
a_4m-# DO
a_4m-# INSTEAD SELECT * FROM sharp_p1;
ERROR: ON SELECT rule may not use OLD
a_4m=# CREATE RU