[GENERAL] Triggers after a rule

2005-09-28 Thread Wijnand Wiersma
Hi list, I am currently trying to give normal users some read access to some tables in the database. I also need to give update access to one column of one table. I have the table contact, the user should not be able to read or update anything in it, except for his own record. So I created the vi

Re: [GENERAL] Triggers after a rule

2005-09-28 Thread Richard Huxton
Wijnand Wiersma wrote: I have the table contact, the user should not be able to read or update anything in it, except for his own record. So I created the view v_my_account. When the user selects * from it he only sees his own record. That works great. I also made a rule: CREATE RULE update_v_my_

Re: [GENERAL] Triggers after a rule

2005-09-28 Thread Wijnand Wiersma
2005/9/28, Richard Huxton : > Wijnand Wiersma wrote: > > I thought that when a rule is applied the triggers which are triggerd > > would also have the same userid as the rule query, but I was wrong. > > Can you show the (cut down) contents of your trigger? It's difficult to > see what you mean. I c

Re: [GENERAL] Triggers after a rule

2005-09-28 Thread Richard Huxton
Wijnand Wiersma wrote: 2005/9/28, Richard Huxton : Wijnand Wiersma wrote: I thought that when a rule is applied the triggers which are triggerd would also have the same userid as the rule query, but I was wrong. Can you show the (cut down) contents of your trigger? It's difficult to see wha

Re: [GENERAL] Triggers after a rule

2005-09-28 Thread Wijnand Wiersma
2005/9/28, Richard Huxton : > The solution is to mark your trigger functions with the "SECURITY > DEFINER" attribute and create them as a user who can access relation > "contact". > http://www.postgresql.org/docs/8.0/static/sql-createfunction.html Damn, I really really missed that one :-( Thank yo

Re: [GENERAL] Triggers after a rule

2005-09-29 Thread Jan Wieck
On 9/28/2005 5:44 AM, Wijnand Wiersma wrote: Hi list, I am currently trying to give normal users some read access to some tables in the database. I also need to give update access to one column of one table. I have the table contact, the user should not be able to read or update anything in it