| From: | Tim Smith <randomdev4+postgres(at)gmail(dot)com> |
|---|---|
| To: | pgsql-general <pgsql-general(at)postgresql(dot)org> |
| Subject: | Delete rule does not prevent truncate |
| Date: | 2015-07-22 12:53:22 |
| Message-ID: | CA+HuS5G2bZYYOGTJrw+VosjUPO298swxuU=JOrFAv54UT7vniQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Hi,
I very much hope this is an accidental bug rather than a deliberate feature !
PostgreSQL 9.4.4
create rule no_auditupd as on update to app_security.app_audit do
instead nothing;
create rule no_auditdel as on delete to app_security.app_audit do
instead nothing;
\d+ app_security.app_audit
<snip>
Rules:
no_auditdel AS
ON DELETE TO app_security.app_audit DO INSTEAD NOTHING
no_auditupd AS
ON UPDATE TO app_security.app_audit DO INSTEAD NOTHING
The truncate trashes the whole table ;-(
According to the FabulousManual(TM) :
event : The event is one of SELECT, INSERT, UPDATE, or DELETE.
Thus I can't create a rule to "do nothing" on truncates, thus I am stuck !
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Melvin Davidson | 2015-07-22 13:03:33 | Re: Delete rule does not prevent truncate |
| Previous Message | Chris Mair | 2015-07-22 12:16:04 | Re: Cannot reach pg server using -h localhost |