[SQL] Delete rules

2010-08-04 Thread Little, Douglas
Hi, We'd like to give our applications truncate capability, but that would also give them drop table permission, which we don't want them to have. So, we created a truncate function that uses the definers security context. The issue is that we now have 1000's of programs to change to use the

Re: [SQL] Delete rules

2010-08-04 Thread Richard Broersma
On Wed, Aug 4, 2010 at 1:25 PM, Little, Douglas douglas.lit...@orbitz.comwrote: But I don’t know how to access the entire sql statement for interrogation. Is there a way I can see what the statement is that’s executing and triggering the rule? I've found complex and simple rules pretty

[SQL] Delete rules and functions

2007-06-26 Thread Wiebe Cazemier
Hi, I have the following scenerio: a rule on a view which executes a function by means of a select call, which in turn deletes from a table which has on-delete rules on it. When the function is called from the rule, the subsequent delete call in the function doesn't cause the on-delete rules on

Re: [SQL] Delete rules and functions

2007-06-26 Thread Tom Lane
Wiebe Cazemier [EMAIL PROTECTED] writes: I have the following scenerio: a rule on a view which executes a function by means of a select call, which in turn deletes from a table which has on-delete rules on it. When the function is called from the rule, the subsequent delete call in the

Re: [SQL] Delete rules and functions

2007-06-26 Thread Wiebe Cazemier
On Tuesday 26 June 2007 22:50, Tom Lane wrote: Please provide an example, because the rewriter is most certainly applied to queries from functions. I suspect you are actually being burnt by some other effect, like a row disappearing from the view as soon as its underlying data is deleted.