how to permit DROP table Azure Database for PostgreSQL flexible server

Yusif Nasirov 5 Reputation points
2024-09-15T14:19:15.5666667+00:00

I want to prevent a user from dropping a table

But at the same time he can create it, but not drop it.

Azure Database for PostgreSQL
{count} votes

1 answer

Sort by: Most helpful
  1. Dillon Silzer 57,311 Reputation points
    2024-09-15T21:17:35.48+00:00

    Hi Yusif,

    Try revoking the user's roles and create a new role with limited abilities:

    For example, create a role with specific privileges:

    CREATE ROLE limited_role;
    GRANT SELECT, INSERT, UPDATE ON ALL TABLES IN SCHEMA public TO limited_role;
    

    Then, assign this role to the user:

    GRANT limited_role TO my_user;
    

    If this is helpful please accept as answer or upvote.

    Best regards,

    Dillon Silzer | Cloudaen.com | Cloudaen Computing Solutions


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.