skip to Main Content

I have a user, who has read access to all the schema. I want to extend his access to create, insert, update and select for only one schema, is there a way.

I tried like

 ALTER DEFAULT PRIVILEGES FOR ROLE user_rd IN SCHEMA schema_name
       GRANT ALL ON TABLES TO user_rd;

But, not working.

Please help.Thank you

2

Answers


  1. This command only affects future tables created by user_rd. You need to use the role that will run the CREATE TABLE statement instead. And no, there is no command to alter default privileges on tables created by any user.

    Login or Signup to reply.
  2. The default works for new tables that you create in the future. For existing tables, you have to use a different command:

    GRANT SELECT, INSERT, UPDATE
    ON ALL TABLES IN SCHEMA schema_name 
    TO user_rd;
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search