Postgres: granting access to a role/user for future tables created by a different role/user

后端 未结 1 1830
北荒
北荒 2021-01-28 07:34

I\'m building a spring boot application. Flyway database migrations are executed at the application startup.

I decided to use two different roles: role__app

相关标签:
1条回答
  • 2021-01-28 08:11

    You should write

    ALTER DEFAULT PRIVILEGES FOR USER role__migration ...
    

    If you omit the FOR USER clause, the privileges are only granted on objects created by the user who ran ALTER DEFAULT PRIVILEGES.

    With the above statement, the privileges are granted when role__migration creates an object. That does not extend to members of the role role__migration.

    0 讨论(0)
提交回复
热议问题