Disable DELETE on table in PostgreSQL? Disable DELETE on table in PostgreSQL? postgresql postgresql

Disable DELETE on table in PostgreSQL?


As I understand a rule would generate additional queries - so a rule could not suppress the original query.

Not really - it could be an INSTEAD rule:

 CREATE RULE shoe_del_protect AS ON DELETE TO shoe DO INSTEAD NOTHING;

(an example on that same page of the manual).

Another way is to REVOKE delete privileges on the table in question and to create stored procedure(s) for deleting... and updating and inserting also probably.