1. Anuncie Aqui ! Entre em contato fdantas@4each.com.br

[SQL] Is it possible to disable delete all query in Postgres?

Discussão em 'Outras Linguagens' iniciado por Stack, Novembro 3, 2024 às 12:22.

  1. Stack

    Stack Membro Participativo

    Is it possible to allow only those DELETE queries that have a WHERE clause in them?

    I've tried to use RULE for that, but I can't figure out what to put into it's WHERE clause, right now this RULE disables all DELETE queries:

    create rule prevent_delete_all as on DELETE to site
    DO INSTEAD NOTHING


    Edit

    Problem with revoking delete access from users and creating stored procedures for calling DELETE is that I don't want to re-write application code that is using the DB

    Continue reading...

Compartilhe esta Página