Postgresql permissions saved

I am running PostgreSQL 9.3.2 on Linux.

I have a group role 'data_scientist' and access rights to a certain (already filled) scheme like

grant usage on schema schemaname to data_scientist;

grant select, references, trigger
    on all tables in schema schemaname
    to data_scientist;

This fixes the data_scientist problem using past tables. For future tables, I added

alter default privileges in schema schemaname
grant select, references on tables
   to data_scientist;

However, whenever a new table is added, other data_scientist permissions fail in the new tables.

+4
source share
1 answer

By default, ALTER DEFAULT PRIVILEGES applies only to the role that executed this command. Suppose we have 2 users: ramfjord and animalito. If I (ramfjord) work

ALTER DEFAULT PRIVILEGES GRANT SELECT ON TABLES TO public; CREATE TABLE ramfjord_table; 

. animalito

CREATE TABLE animalito_table

ramfjord , ramfjord . . \ddp

- GRANT. ,

ALTER DEFAULT PRIVILEGES FOR ROLE <owner> REVOKE...

, , , \ddp , - . , ... .

+1

Source: https://habr.com/ru/post/1544966/


All Articles