Re: [GENERAL] Rules on Select

2006-05-05 Thread elein
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

Re: [GENERAL] Rules on Select

2006-05-05 Thread Tony Wasson
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

Re: [GENERAL] Rules on Select

2006-05-05 Thread Hogan, James F. Jr.
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

[GENERAL] Rules on Select

2006-05-05 Thread Sean Hamilton
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

Re: [GENERAL] Rules on select

2005-01-17 Thread Rick Schumeyer
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

[GENERAL] Rules on select

2005-01-17 Thread Mariusz Czułada
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