Delete rules - Mailing list pgsql-sql

From Little, Douglas
Subject Delete rules
Date
Msg-id 8585BA53443004458E0BAA6134C5A7FB0CB296B2@EGEXCMB01.oww.root.lcl
Whole thread Raw
Responses Re: Delete rules
List pgsql-sql

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 function.  A task the developers don’t want to do.

 

So,  we’re investigating using a DELETE rule.  I’d like to be able to rewrite   an unqualified delete into a the call to the truncate function otherwise, leave it alone.

 

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?

 

Thanks

 

 

Doug Little

 

Sr. Data Warehouse Architect | Enterprise Data Management | Orbitz Worldwide

500 W. Madison, Suite 1000  Chicago IL 60661| Office 312.260.2588 | Fax 312.894.5164 | Cell 847-997-5741

Douglas.Little@orbitz.com

 cid:image001.jpg@01CABEC8.D4980670  orbitz.com | ebookers.com | hotelclub.com | cheaptickets.com | ratestogo.com | asiahotels.com

 

pgsql-sql by date:

Previous
From: Andreas Joseph Krogh
Date:
Subject: Re: workaround for missing ROWNUM feature with the help of GUC variables
Next
From: Frank Bax
Date:
Subject: Re: What does PostgreSQL do when time goes backward?