Delete rules

From: "Little, Douglas" <DOUGLAS(dot)LITTLE(at)orbitz(dot)com>
To: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Delete rules
Date: 2010-08-04 20:25:03
Message-ID: 8585BA53443004458E0BAA6134C5A7FB0CB296B2@EGEXCMB01.oww.root.lcl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(dot)Little(at)orbitz(dot)com<mailto:Douglas(dot)Little(at)orbitz(dot)com>
[cid:image001(dot)jpg(at)01CB33E9(dot)35FEAAF0] orbitz.com<http://www.orbitz.com/> | ebookers.com<http://www.ebookers.com/> | hotelclub.com<http://www.hotelclub.com/> | cheaptickets.com<http://www.cheaptickets.com/> | ratestogo.com<http://www.ratestogo.com/> | asiahotels.com<http://www.asiahotels.com/>

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Frank Bax 2010-08-04 21:33:48 Re: What does PostgreSQL do when time goes backward?
Previous Message Justin Graf 2010-08-04 20:24:44 Re: Domains, casts, and MS Access